public final class LoggerFactory extends Object
Logger
instances returned by this
factory are immutable and hence it will always be retuning the same object for identical parameters. So it is safe to
use the LoggerFactory.getLogger(parameters)
multiple times to acquire the logger, as that will not
result in any new object creation
This behavior makes it usable in mediation where the state is not managed (such as Java fragment sequences), where it could get a reference to the logger in each and every message, which will return the same object for all the messages.
The loggers returned by this factory supports few built-in MDC like arguments. The set of MDC arguments include;
MDC Key | Contextual Value |
---|---|
xs | The default status code of the logger which is used unless a contextual status code is not provided |
Logger
Constructor and Description |
---|
LoggerFactory() |
Modifier and Type | Method and Description |
---|---|
static Logger |
getExistingLogger(String name)
Returns an existing logger from the cache without creating a new logger on absence
|
static Logger |
getLogger(Class<?> clazz) |
static Logger |
getLogger(String name,
int componentType,
int moduleId,
int loggerId)
Gives an immutable
Logger representing the given logger name and following extension point values. |
static void |
shutdown()
Shuts down the underlying logging framework
|
public static Logger getLogger(String name, int componentType, int moduleId, int loggerId)
Logger
representing the given logger name and following extension point values.name
- the name of the logger to be acquiredcomponentType
- the component type of the logger, which can be one of [0..9] as per ComponentType
moduleId
- the module id which is a 3 digit numberloggerId
- the logger id which is a 2 digit numberpublic static Logger getExistingLogger(String name)
name
- the name of the logger to be acquiredpublic static void shutdown()
Copyright © 2016–2019 AdroitLogic. All rights reserved.