- SLF4J API
- FR I18N framework (i18n-core component)
The I18N framework provides in the i18n-slf4j module, a
LocalizedLoggerclass, which should be used everywhere in the code to log messages and?/or exceptions.
LocalizedLoggerclass delegates to SLF4J API.
An SLF4J implementation can be choosed chosen at runtime by providing the appropriate jar in the classpath. In particular, two implementations are used:
- OpenDJ implementation, used when the
opendj-slf4j-adapterjar is included. It delegate to
DebugLoggerclasses from OpenDJ server.
- this implementation is used in the server.
- java.util.logging implementation, used when the
slf4j-jdk14jar is included.
- this implementation is used in the tools.
A message can be logged using the following levels (provided by SLF4J API and
Each logged message has a category. The category is given by the classname where the message is logged.
This allow allows to define a single logger per class, with the classname.
There is a mapping between packages (information which is included in classnames) and these simple categories. If a class does not map to a pre-defined package, then its category is its fully qualified class name.
For example, all classes in the
org.forgerock.opendj.server.core package or a sub-package are mapped to the
logger.trace("a debug message with arg1 : %s and arg2 : %s", arg1, arg2)
There is also a specific method to trace an exception in addition to the message:
logger.traceException(anException, "a debug message with arg1 : %s and arg2 : %s", arg1, arg2)