How to log all incoming msgs of Queue "hello" into a separate logfile?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to log all incoming msgs of Queue "hello" into a separate logfile?

BenXS
How can I log all incoming msgs in Queue "hello" into a separate logfile

D:\dev\activemq\hello.log

As far as I understand I have to active logging at first according to the Logging Interceptor described here:

http://activemq.apache.org/logging-interceptor.html

Ok, I specify:

...
<loggingBrokerPlugin logConsumerEvents="true"/>
....

But how to I restrict the logging to Queue "hello"?

How do I specify a special logfile for this?

Ben





Reply | Threaded
Open this post in threaded view
|

Re: How to log all incoming msgs of Queue "hello" into a separate logfile?

Torsten Mielke-2
Hi,

I don't think you can configure the logging plugin to only log msgs sent to a certain destination into a separate log file.
However you can configure log4j so that all output from the logging plugin goes into a separate log file.
E.g. add the following configuration to your conf/log4j.properties file


################
# Logging Plugin
################

log4j.additivity.org.apache.activemq.broker.util.LoggingBrokerPlugin=false
log4j.logger.org.apache.activemq.broker.util.LoggingBrokerPlugin=INFO, logger
log4j.appender.logger=org.apache.log4j.RollingFileAppender
log4j.appender.logger.file=${activemq.base}/data/logger.log
log4j.appender.logger.maxFileSize=1024KB
log4j.appender.logger.maxBackupIndex=5
log4j.appender.logger.append=true
log4j.appender.logger.layout=org.apache.log4j.PatternLayout
log4j.appender.logger.layout.ConversionPattern=%d %-5p | %m | %t%n


All data logged by the logging plugin will then go into data/logger.log file.


Hope this helps.
Torsten




On Mar 20, 2012, at 8:29 AM, Ben Stover wrote:

> How can I log all incoming msgs in Queue "hello" into a separate logfile
>
> D:\dev\activemq\hello.log
>
> As far as I understand I have to active logging at first according to the Logging Interceptor described here:
>
> http://activemq.apache.org/logging-interceptor.html
>
> Ok, I specify:
>
> ...
> <loggingBrokerPlugin logConsumerEvents="true"/>
> ....
>
> But how to I restrict the logging to Queue "hello"?
>
> How do I specify a special logfile for this?
>
> Ben
>
>
>
>
>

Torsten Mielke
[hidden email]
[hidden email]



Reply | Threaded
Open this post in threaded view
|

Re: How to log all incoming msgs of Queue "hello" into a separate logfile?

gtully
In reply to this post by BenXS
that sounds like a nice enhancement to the logging broker plugin. It
would be easy to implement by appending the destination name to the
logger request.
Have opened https://issues.apache.org/jira/browse/AMQ-3779 to track
this. It does raise the question about composite destinations, should
there be a unique log entry per destination or should they be in their
own log?


On 20 March 2012 07:29, Ben Stover <[hidden email]> wrote:

> How can I log all incoming msgs in Queue "hello" into a separate logfile
>
> D:\dev\activemq\hello.log
>
> As far as I understand I have to active logging at first according to the Logging Interceptor described here:
>
> http://activemq.apache.org/logging-interceptor.html
>
> Ok, I specify:
>
> ...
> <loggingBrokerPlugin logConsumerEvents="true"/>
> ....
>
> But how to I restrict the logging to Queue "hello"?
>
> How do I specify a special logfile for this?
>
> Ben
>
>
>
>
>



--
http://fusesource.com
http://blog.garytully.com
Reply | Threaded
Open this post in threaded view
|

Re: How to log all incoming msgs of Queue "hello" into a separate logfile?

BenXS
In reply to this post by Torsten Mielke-2
Ok, thank you.

Just for clarification:

The log4j.properties you mentioned are only active when I setup before
the Logging Interceptor Plugin as described in

http://activemq.apache.org/logging-interceptor.html

If the user did NOT add an entry like:

<plugins>
...
</plugins>

then no log4j logging takes place.

Correct?

Ben