You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Maenxe <ma...@docmagic.com> on 2008/08/28 01:11:27 UTC

Question about Logging in ActiveMQ 5.1

I'd like to setup log4j to log when a message was received by the broker, and
when a consumer retrieved it.  Is there a way to do this?  It seems the
default logging options are simply INFO, WARN, ERROR, FATAL, and DEBUG. 
We're currently using INFO, but would like a little more granular detail.

M@
-- 
View this message in context: http://www.nabble.com/Question-about-Logging-in-ActiveMQ-5.1-tp19191517p19191517.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


RE: Question about Logging in ActiveMQ 5.1

Posted by Gabe Westmaas <ga...@mailtrust.com>.
Not by default, I don't believe.  Our organization added logging to a few places to achieve just that, but frankly it seems like overkill and since I took over the project I have never actually had to use those logs.

You can use camel inside the broker to log messages when they arrive, I don't know about when they are retrieved, but I think that would be more of a client function.

Gabe

-----Original Message-----
From: "Maenxe" <ma...@docmagic.com>
Sent: Wednesday, August 27, 2008 7:11pm
To: users@activemq.apache.org
Subject: Question about Logging in ActiveMQ 5.1


I'd like to setup log4j to log when a message was received by the broker, and
when a consumer retrieved it.  Is there a way to do this?  It seems the
default logging options are simply INFO, WARN, ERROR, FATAL, and DEBUG. 
We're currently using INFO, but would like a little more granular detail.

M@
-- 
View this message in context: http://www.nabble.com/Question-about-Logging-in-ActiveMQ-5.1-tp19191517p19191517.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.




Re: Question about Logging in ActiveMQ 5.1

Posted by James Strachan <ja...@gmail.com>.
2008/9/5 MaenXe <ma...@docmagic.com>:
>
> Well, I thought this was what I needed, but after examining the logs, this
> isn't gonna do.  For one, it puts the entire payload of the message into the
> log P-(, basically what I'm looking for is something similar to the apache
> logs, or a mail log.  I need producer/consumer ID, queue/topic, msg ID, and
> timestamp.  I don't imagine this would be hard, but I'm surprised that it
> doesn't seem to be implemented already.
>
> Is there a way to modify the data logged by the interceptor to trim out
> excess junk?
> Is there a way I can tweak log4j to get this?
>
> The purpose of this is that we want to refer to logs to follow the path of a
> message for troubleshooting.

FWIW log4j typically only lets you turn on or off logs - or reformat
how the log information is formatted (things like thread, time, logger
and so forth); but it ultimately doesn't let you modify the text that
is logged.

How about you try modifying the LoggingInterceptor to do exactly what
you want - so it can be configured to turn on or off the message
payload being logged? We love patches and contributions!
http://activemq.apache.org/contributing.html

BTW you might find the Camel Tracer interesting; it kinda does the
same thing you're trying to do - but at the Camel endpoint layer
rather than the JMS broker layer...
http://activemq.apache.org/camel/tracer.html

in particularly its highly configurable so you can turn on and off
different items to be logged.

If it helps, here's the Camel TraceInterceptor
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceInterceptor.java?view=markup

and the TraceFormatter that configures the formatting of the trace message
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceFormatter.java?view=markup

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Re: Question about Logging in ActiveMQ 5.1

Posted by MaenXe <ma...@docmagic.com>.
Well, I thought this was what I needed, but after examining the logs, this
isn't gonna do.  For one, it puts the entire payload of the message into the
log P-(, basically what I'm looking for is something similar to the apache
logs, or a mail log.  I need producer/consumer ID, queue/topic, msg ID, and
timestamp.  I don't imagine this would be hard, but I'm surprised that it
doesn't seem to be implemented already.

Is there a way to modify the data logged by the interceptor to trim out
excess junk?
Is there a way I can tweak log4j to get this?

The purpose of this is that we want to refer to logs to follow the path of a
message for troubleshooting.

M@

-- 
View this message in context: http://www.nabble.com/Question-about-Logging-in-ActiveMQ-5.1-tp19191517p19322182.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Question about Logging in ActiveMQ 5.1

Posted by MaenXe <ma...@docmagic.com>.
Thanks Gary!  That was what I needed!

M@


Have not tried this but it looks promising

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

also, with log4j it is possible to specify the logging level on a per
class or package basis. see the examples in conf/log4j.configuration.


-- 
View this message in context: http://www.nabble.com/Question-about-Logging-in-ActiveMQ-5.1-tp19191517p19222518.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Question about Logging in ActiveMQ 5.1

Posted by Gary Tully <ga...@gmail.com>.
Have not tried this but it looks promising

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

also, with log4j it is possible to specify the logging level on a per
class or package basis. see the examples in conf/log4j.configuration.

2008/8/28 Maenxe <ma...@docmagic.com>:
>
> I'd like to setup log4j to log when a message was received by the broker, and
> when a consumer retrieved it.  Is there a way to do this?  It seems the
> default logging options are simply INFO, WARN, ERROR, FATAL, and DEBUG.
> We're currently using INFO, but would like a little more granular detail.
>
> M@
> --
> View this message in context: http://www.nabble.com/Question-about-Logging-in-ActiveMQ-5.1-tp19191517p19191517.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>