Adapter that delegates the log output process of log output function provided by Nablarch to the following log framework.
Use an adapter to unify loggers according to customer requests and products to be used. When an adapter is used, all log output processing using the log output function of Nablarch is delegated to the selected logging framework.
The log4j adapter that was provided up to Nablarch5u15 uses log4j1.2 (external site). log4j 1.2 is EOL. Therefore, the log4j adapter has been deprecated as no fix for the vulnerability has been published. Use slf4j or JBoss Logging.
For details on how to configure the logging framework, refer to the product manual.
<!-- slf4j adaptor --> <dependency> <groupId>com.nablarch.integration</groupId> <artifactId>nablarch-slf4j-adaptor</artifactId> </dependency>
With nablarch-slf4j-adaptor, FATAL log level is mapped to ERROR log level because FATAL log level is not supported by slf4j.
Tests are conducted using slf4j version 1.7.22. When changing the version, test in the project to confirm that there are no problems.
<!-- JBoss Logging adapter --> <dependency> <groupId>com.nablarch.integration</groupId> <artifactId>nablarch-jboss-logging-adaptor</artifactId> </dependency>
Tests are conducted using JBoss Logging version 3.3.0 Final. When changing the version, test in the project to confirm that there are no problems.
Configuration settings for using the logging framework¶
Configure the following in the configuration file (log.properties) of log output function. With this configuration, the log output process is delegated to the logging framework.
# configure factory to use slf4j loggerFactory.className=nablarch.integration.log.slf4j.Slf4JLoggerFactory
# configure factory to use JBoss Logging loggerFactory.className=nablarch.integration.log.jbosslogging.JbossLoggingLoggerFactory