KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > contineo > core > LoggingManager


1 /*
2  * LoggingManager.java
3  *
4  * Created on 29. August 2003, 15:59
5  */

6
7 package org.contineo.core;
8
9 import org.apache.log4j.Logger;
10 import org.apache.log4j.xml.DOMConfigurator;
11 /**
12  * This class is a manager for logging and debugging.
13  * @author Michael Scholz
14  * @version 1.0
15  */

16 public class LoggingManager {
17
18     private static Logger logger;
19     
20     /**
21      * This method instanciates a logger for a specified class.
22      * @param clazz Class for logging.
23      */

24     public static Logger getLogger(Class JavaDoc clazz) {
25         logger = Logger.getLogger(clazz);
26         ClassLoader JavaDoc loader = Thread.currentThread().getContextClassLoader();
27         DOMConfigurator.configure(loader.getResource("logging.xml"));
28         return logger;
29     }
30 }
31
Popular Tags