クライアントでのログ記録を有効にする場合は、SLF4J ファサードをサポートするログ記録実装をアプリケーションに含める必要があります。Maven を使用している場合は、Log4j 2 に次の依存関係を追加します。
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>2.28.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.19.0</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>2.28.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.19.0</version>
</dependency>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
-Dlog4j2.configurationFile=file:///path/to/custom-log4j2-config.properties
-Dlog4j2.configurationFile=file:///path/to/custom-log4j2-config.properties
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
Log4J 2 configuration
Monitor config file every X seconds for updates
Console appender
Log file appender
# Log4J 2 configuration
# Monitor config file every X seconds for updates
monitorInterval = 5
rootLogger = INFO, console, log_file
logger.activemq.name=org.apache.activemq
logger.activemq.level=INFO
# Console appender
appender.console.type=Console
appender.console.name=console
appender.console.layout.type=PatternLayout
appender.console.layout.pattern=%d %-5level [%logger] %msg%n
# Log file appender
appender.log_file.type = RollingFile
appender.log_file.name = log_file
appender.log_file.fileName = log/application.log
appender.log_file.filePattern = log/application.log.%d{yyyy-MM-dd}
appender.log_file.layout.type = PatternLayout
appender.log_file.layout.pattern = %d %-5level [%logger] %msg%n
appender.log_file.policies.type = Policies
appender.log_file.policies.cron.type = CronTriggeringPolicy
appender.log_file.policies.cron.schedule = 0 0 0 * * ?
appender.log_file.policies.cron.evaluateOnStartup = true
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow