-
Copy the following jar in ${activemq.base}/lib:
logback-access-1.0.0.jar logback-classic-1.0.0.jar
-
Create a logback.xml file in ${activemq.base}/conf, for example:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> <!-- For assistance related to logback-translator or configuration --> <!-- files in general, please contact the logback user mailing list --> <!-- at http://www.qos.ch/mailman/listinfo/logback-user --> <!-- --> <!-- For professional support please see --> <!-- http://www.qos.ch/shop/products/professionalSupport --> <!-- --> <configuration scan="true" debug="true"> <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>[%t] [%4p] [%d{ISO8601}] %c{1}: %m%n</pattern> </encoder> </appender> <appender name="R" class="ch.qos.logback.core.rolling.RollingFileAppender"> <File>${activemq.base}/logs/activemq.log</File> <encoder> <pattern>[%t] [%4p] [%d{ISO8601}] %c{1}: %m%n</pattern> </encoder> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>${activemq.base}/logs/activemq.log.%d{yyyy-MM-dd-HH}</fileNamePattern> </rollingPolicy> </appender> <logger name="org.apache.activemq.spring" additivity="false"> <level value="WARN"/> <appender-ref ref="R" /> <appender-ref ref="stdout" /> </logger> <logger name="org.apache.activemq.web.handler" additivity="false"> <level value="WARN"/> <appender-ref ref="R" /> <appender-ref ref="stdout" /> </logger> <logger name="org.apache.activemq.xbean" additivity="false"> <level value="WARN"/> <appender-ref ref="R" /> <appender-ref ref="stdout" /> </logger> <logger name="org.apache.camel" additivity="false"> <level value="INFO"/> <appender-ref ref="R" /> <appender-ref ref="stdout" /> </logger> <logger name="org.apache.activemq" additivity="false"> <level value="INFO"/> <appender-ref ref="R" /> <appender-ref ref="stdout" /> </logger> <logger name="json_processor" additivity="false"> <level value="DEBUG"/> <appender-ref ref="R" /> <appender-ref ref="stdout" /> </logger> <logger name="ldap_result_processor" additivity="false"> <level value="DEBUG"/> <appender-ref ref="R" /> <appender-ref ref="stdout" /> </logger> <root level="INFO"> <appender-ref ref="stdout"/> <appender-ref ref="R"/> </root> </configuration>
That's all.
What about the activemq logback logging to a jms system which is activemq?
No comments:
Post a Comment