|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openuat.log.LogFactory
public abstract class LogFactory
The public interface of this class provides the two static methods
init and getLogger, which conveniently
allow to receive a suitable logger for the current system. It is
important that init is called before the first
call to getLogger, else it will return a default empty
logger that just does nothing.
Usage and code example:
Initialize the LogFactory in the applications main class,
e.g. in the class inheriting from MIDlet (J2ME) or the class
containing the main method (J2SE):
LogFactory.init(new Log4jFactory());or
LogFactory.init(new MicrologFactory());Then you can obtain a
Log instance in any other class with:
Log logger = LogFactory.getLogger("my.named.logger");
Log| Constructor Summary | |
|---|---|
LogFactory()
|
|
| Method Summary | |
|---|---|
static Log |
getLogger(java.lang.String name)
Requests a logger from the underlying logging framework and returns it, wrapped in a Log instance. |
static void |
init(LogFactory FactoryInstance)
Initializes the LogFactory. |
protected abstract Log |
newLogger(java.lang.String name)
Creates a new wrapper around a logger from the underlying logging framework. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LogFactory()
| Method Detail |
|---|
public static void init(LogFactory FactoryInstance)
LogFactory.getLogger.
FactoryInstance - a new LogFactory instance.
It is always an instance of a subclass of LogFactory,
since LogFactory itself is abstract.public static Log getLogger(java.lang.String name)
Log instance.
name - The name of the requested logger.
LogFactory has not been initialized.protected abstract Log newLogger(java.lang.String name)
name - The name of the new logger.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||