|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sibvisions.util.log.LoggerFactory
public abstract class LoggerFactory
The LoggerFactory
is a factory for creating ILogger
instances,
for the configured log technology.
To use the configured log factory implement the following call in your starter:
LoggerFactory.init("com.package.log.MyLoggerFactory");
Later you can create an ILogger
instance and use it as follows:
ILogger logger = LoggerFactory.getInstance("com.project.MyWindow");
.
logger.debug("My first log message!");
Field Summary | |
---|---|
static java.lang.String |
LOGFACTORY_DEFAULT
the constant name for the default logger factory implementation. |
Constructor Summary | |
---|---|
protected |
LoggerFactory()
Invisible constructor, because the LoggerFactory is a utility class. |
Method Summary | |
---|---|
abstract ILogger |
createLogger(java.lang.String pName)
Creates an ILogger . |
static void |
destroy()
Destroys the internal cache and logging configuration. |
static ILogger |
getInstance(java.lang.Class pClass)
Construct (if necessary) and return an ILogger instance, using the factory's
current set of configuration attributes. |
static ILogger |
getInstance(java.lang.String pName)
Construct (if necessary) and return an ILogger instance, using the factory's
current set of configuration attributes. |
static ILogger.LogLevel |
getLevel(java.lang.Class pClass)
Gets the level of a specific logger. |
static ILogger.LogLevel |
getLevel(java.lang.String pName)
Gets the level of a specific logger. |
static java.util.List<ILogger> |
getLogger()
Gets all created logger instances. |
abstract void |
init()
Initializes the factory instance. |
static void |
init(java.lang.String pClassName)
Creates a new instance of LoggerFactory . |
protected boolean |
isInitDone()
Gets whether factory is initialized. |
static boolean |
isInitialized()
Gets whether this factory has been initialized. |
static void |
setLevel(java.lang.Class pClass,
ILogger.LogLevel pLevel)
Sets the level of a specific logger. |
static void |
setLevel(java.lang.String pName,
ILogger.LogLevel pLevel)
Sets the level of a specific logger. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LOGFACTORY_DEFAULT
Constructor Detail |
---|
protected LoggerFactory()
LoggerFactory
is a utility class.
Method Detail |
---|
public abstract ILogger createLogger(java.lang.String pName)
ILogger
.
pName
- the name for which a logger should be returned/created
ILogger
implementationpublic abstract void init()
public static void init(java.lang.String pClassName)
LoggerFactory
. If the pClassName
was not
found then the JdkLoggerFactory
will be instantiated.
pClassName
- the log factory implementationpublic static boolean isInitialized()
true
if already initialized, false
otherwisepublic static void destroy()
public static ILogger getInstance(java.lang.Class pClass)
ILogger
instance, using the factory's
current set of configuration attributes.
pClass
- the class for which a logger should be returned/created
java.lang.RuntimeException
- if the log factory was not initializedgetInstance(String)
public static ILogger getInstance(java.lang.String pName)
ILogger
instance, using the factory's
current set of configuration attributes.
pName
- the name for which a logger should be returned/created
java.lang.RuntimeException
- if the log factory was not initializedpublic static void setLevel(java.lang.Class pClass, ILogger.LogLevel pLevel)
pClass
- the classpLevel
- the log levelpublic static void setLevel(java.lang.String pName, ILogger.LogLevel pLevel)
pName
- the logger namepLevel
- the log levelpublic static ILogger.LogLevel getLevel(java.lang.Class pClass)
pClass
- the class
public static ILogger.LogLevel getLevel(java.lang.String pName)
pName
- the logger name
public static java.util.List<ILogger> getLogger()
ILogger
sprotected boolean isInitDone()
true
in any case because only init()
creates a new factory instance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |