|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.fhg.igd.logging.LoggerFactory
This factory knows how to create new, and dynamically update already
deployed Logger
objects depending on the currently chosen
underlying logging mechanism. getLogger()
or
getLogger(String)
respectively are intended
to be called in order to request Logger
instances.
Field Summary | |
static String |
AUTO_LOGGER
The identifier for automatic detection of the logging mechanism |
protected static List |
logger_priorities_
The priority list of underlying logging mechanisms |
protected static String |
PKG_PREFIX_
The package prefix |
static String |
PROPERTIES_RESOURCE
The factory properties resource file |
static String |
PROPERTY_LOGGER_PRIORITIES
The name of the logger priorities property within the resource file |
private static Set |
proxies_
The storage for all deployed LoggerProxy objects |
protected static Class |
wclazz_
The current wrapper class (will be initialized along with LoggingConfiguration ) |
Constructor Summary | |
private |
LoggerFactory()
Hidden unused construction. |
Method Summary | |
protected static void |
changeLogger(String logger)
Change the underlying logging mechanism and implicitly update all deployed proxies. |
protected static void |
dismissProxy(LoggerProxy proxy)
Remove a proxy from the cache. |
private static Class |
findWrapperClass(String logger)
Find the corresponding Wrapper implementation class for
the given underlying logging mechanism. |
static Logger |
getLogger()
Get a ready-to-use groupless logger object. |
static Logger |
getLogger(String group)
Get a ready-to-use logger object with the specified group name. |
protected static String |
underlyingLoggingMechanism()
Get the short name of the underlying logging mechanism (as it is expected in LoggingConfiguration.setLogger(String) ) that is
currently in use. |
protected static void |
updateProxies()
Update proxies in case a better matching target is available. |
private static void |
updateProxies(Class wclazz,
boolean exchange)
Perform an update of proxy targets, either in case of a logger change, when all deployed instances definitely need to be exchanged, or in case a better match may be available. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String PROPERTIES_RESOURCE
public static final String PROPERTY_LOGGER_PRIORITIES
resource file
public static final String AUTO_LOGGER
protected static final String PKG_PREFIX_
private static Set proxies_
LoggerProxy
objects
protected static List logger_priorities_
protected static Class wclazz_
LoggingConfiguration
)
Constructor Detail |
private LoggerFactory()
Method Detail |
public static Logger getLogger()
public static Logger getLogger(String group)
group
- The logger's group name
IllegalArgumentException
- if the group
is
null
protected static String underlyingLoggingMechanism()
LoggingConfiguration.setLogger(String)
) that is
currently in use.
protected static void updateProxies()
private static void updateProxies(Class wclazz, boolean exchange)
wclazz
- The currently matching Wrapper
classexchange
- true
if targets should get exchanged in
any case after the underlying logging mechanism has been exchanged,
otherwise only if there is a better matching target available
LoggingException
- in case one of the new targets could not be
createdprotected static void changeLogger(String logger)
logger
- The name of the new underlying logging mechanismprivate static Class findWrapperClass(String logger)
Wrapper
implementation class for
the given underlying logging mechanism.
logger
- The name of underlying logging mechanism
Wrapper
implemenatation class for the
given underlying logging mechanism
LoggingException
- in case the requested underlying logging
mechanism is not availableprotected static void dismissProxy(LoggerProxy proxy)
LoggerProxy.finalize()
.
proxy
- The proxy to be dismissed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |