log Adapter

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.

Important

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.

Tip

For details on how to configure the logging framework, refer to the product manual.

Module list

slf4j

<!-- slf4j adaptor -->
<dependency>
  <groupId>com.nablarch.integration</groupId>
  <artifactId>nablarch-slf4j-adaptor</artifactId>
</dependency>

Important

With nablarch-slf4j-adaptor, FATAL log level is mapped to ERROR log level because FATAL log level is not supported by slf4j.

Tip

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

<!-- JBoss Logging adapter -->
<dependency>
  <groupId>com.nablarch.integration</groupId>
  <artifactId>nablarch-jboss-logging-adaptor</artifactId>
</dependency>

Tip

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.

slf4j

# configure factory to use slf4j
loggerFactory.className=nablarch.integration.log.slf4j.Slf4JLoggerFactory

JBoss Logging

# configure factory to use JBoss Logging
loggerFactory.className=nablarch.integration.log.jbosslogging.JbossLoggingLoggerFactory