简体   繁体   中英

For ActiveMQ Artemis, how to separate the log message produced by LoggingActiveMQServerPlugin into different log file?

I turn on LoggingActiveMQServerPlugin in order to record some information. But I don't want those information in artemis.log. I hope those information could be saved into a separated file so that I can manage it easily.

I know I should work with the file logging.properties , but I don't know how to configure the file. Could anybody provide a samlpe?

Appreciate.

Here's what you need to do:

  1. Add org.apache.activemq.artemis.core.server.plugin.impl to the loggers list.
  2. Direct org.apache.activemq.artemis.core.server.plugin.impl to a new handler
  3. Configure the new handler to point to a unique file.

For example, this configuration will direct output from the LoggingActiveMQServerPlugin to logging_plugin.log in the log directory next to artemis.log :

...
loggers=...,org.apache.activemq.artemis.core.server.plugin.impl
...
logger.org.apache.activemq.artemis.core.server.plugin.impl.level=ERROR
logger.org.apache.activemq.artemis.core.server.plugin.impl.handlers=LOGGING_PLUGIN
logger.org.apache.activemq.artemis.core.server.plugin.impl.useParentHandlers=false
...
handler.LOGGING_PLUGIN=org.jboss.logmanager.handlers.PeriodicRotatingFileHandler
handler.LOGGING_PLUGIN.level=DEBUG
handler.LOGGING_PLUGIN.properties=suffix,append,autoFlush,fileName
handler.LOGGING_PLUGIN.suffix=.yyyy-MM-dd
handler.LOGGING_PLUGIN.append=true
handler.LOGGING_PLUGIN.autoFlush=true
handler.LOGGING_PLUGIN.fileName=${artemis.instance}/log/logging_plugin.log
handler.LOGGING_PLUGIN.formatter=PATTERN

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM