You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by degenaro <lo...@gmail.com> on 2011/05/08 12:37:07 UTC

Hide ActiveMQ log4j messages

My client java code puts data on a queue to be processed by a server, but
these logging messages shown to the client are unwanted:

May 8, 2011 6:27:09 AM
org.apache.activemq.transport.failover.FailoverTransport doReconnect
INFO: Successfully connected to tcp://localhost:61616

I'm using activemq-all-5.4.1.jar

How do I hide them?

Thanks.

Lou.

--
View this message in context: http://activemq.2283324.n4.nabble.com/Hide-ActiveMQ-log4j-messages-tp3506729p3506729.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Hide ActiveMQ log4j messages

Posted by Maria <ma...@hotmail.com>.
I do not know if it is useful yet. 
But to hide the message what has to be added to the log4j properties file
is:
log4j.logger.org.apache.activemq.transport.failover.FailoverTransport=ERROR

instead of
log4j.logger.org.apache.activemq.transport.failover.FailoverTransport.level=ERROR

The first one seems to work.





--
View this message in context: http://activemq.2283324.n4.nabble.com/Hide-ActiveMQ-log4j-messages-tp3506729p4656049.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Hide ActiveMQ log4j messages

Posted by degenaro <lo...@gmail.com>.
Cool beans!  The log4j used is, according to the trace, the one for my
application...

log4j: Trying to find [log4j.xml] using context classloader
sun.misc.Launcher$AppClassLoader@51f12c4e.
log4j: Trying to find [log4j.xml] using
sun.misc.Launcher$AppClassLoader@51f12c4e class loader.
log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource().
log4j: Trying to find [log4j.properties] using context classloader
sun.misc.Launcher$AppClassLoader@51f12c4e.
log4j: Using URL
[file:/data/home/degenaro/workspace/org.apache.ducc.jm/bin/log4j.properties]
for automatic log4j configuration.
log4j: Reading configuration from URL
file:/data/home/degenaro/workspace/org.apache.ducc.jm/bin/log4j.properties
log4j: Parsing for [root] with value=[INFO, A1].
log4j: Level token is [INFO].
log4j: Category root set to INFO
log4j: Parsing appender named "A1".
log4j: Parsing layout options for "A1".
log4j: Setting property [conversionPattern] to [%d %m%n].
log4j: End of parsing for "A1".
log4j: Parsed "A1" options.
log4j: Finished configuring.
May 9, 2011 9:37:22 AM
org.apache.activemq.transport.failover.FailoverTransport doReconnect
INFO: Successfully connected to tcp://localhost:61616

but the part for ActiveMQ 

org.apache.activemq.transport.failover.FailoverTransport.level=ERROR

seems to be ignored, even though it's included (at the bottom) of my
properties file (see previous append).

Is there something more I need to specify?

Thanks.

Lou.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Hide-ActiveMQ-log4j-messages-tp3506729p3509308.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Hide ActiveMQ log4j messages

Posted by Stan Lewis <sl...@fusesource.com>.
You can pass -Dlog4j.debug=true on your command line to find out where
log4j is picking up it's configuration and how it's parsing it.

On Mon, May 9, 2011 at 6:44 AM, degenaro <lo...@gmail.com> wrote:
> Thanks for your reply.  I think one of my problems is that I don't know where
> the log4j.properties file that needs to be modified is!
>
> My application code is using log4j too.  Without success, I tried updating
> its log4.properties file thus:
>
> # Set root logger level to INFO and its only appender to A1.
> log4j.rootLogger=WARN, A1
>
> # A1 is set to be a ConsoleAppender.
> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>
> # A1 uses PatternLayout.
> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> log4j.appender.A1.layout.ConversionPattern=%d %m%n
>
> log4j.logger.org.apache.activemq.transport.failover.FailoverTransport.level=ERROR
>
> Lou.
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Hide-ActiveMQ-log4j-messages-tp3506729p3508906.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

RE: Hide ActiveMQ log4j messages

Posted by degenaro <lo...@gmail.com>.
Thanks for your reply.  I think one of my problems is that I don't know where
the log4j.properties file that needs to be modified is!  

My application code is using log4j too.  Without success, I tried updating
its log4.properties file thus:

# Set root logger level to INFO and its only appender to A1.
log4j.rootLogger=WARN, A1

# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d %m%n

log4j.logger.org.apache.activemq.transport.failover.FailoverTransport.level=ERROR 

Lou.

--
View this message in context: http://activemq.2283324.n4.nabble.com/Hide-ActiveMQ-log4j-messages-tp3506729p3508906.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

RE: Hide ActiveMQ log4j messages

Posted by "Swindells, Thomas" <TS...@nds.com>.
Just configure your logging the way you want it - presumably you are using log4j in which case you probably want to add into your logging.properties file an entry like the following

log4j.logger.org.apache.activemq.transport.failover.FailoverTransport.level=ERROR

Thomas

> -----Original Message-----
> From: degenaro [mailto:lou.degenaro@gmail.com]
> Sent: 08 May 2011 11:37
> To: users@activemq.apache.org
> Subject: Hide ActiveMQ log4j messages
>
> My client java code puts data on a queue to be processed by a server, but
> these logging messages shown to the client are unwanted:
>
> May 8, 2011 6:27:09 AM
> org.apache.activemq.transport.failover.FailoverTransport doReconnect
> INFO: Successfully connected to tcp://localhost:61616
>
> I'm using activemq-all-5.4.1.jar
>
> How do I hide them?
>
> Thanks.
>
> Lou.
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Hide-
> ActiveMQ-log4j-messages-tp3506729p3506729.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.


**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************