You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by fehm <Fe...@cern.ch> on 2010/02/11 16:20:41 UTC

Re: Log4J ActiveMQ JMS Appender

Hi,

although this topic seems to be outdated and I have read the documentation :
is there a solution/hint to this issue ?

Unfortunately, I'm experiencing the same with the following log4j config :

laser.conversion.pattern=%d{HH:mm:ss} [%-20t] %-5p %-20c{1} ==> %m%n
# two appenders have been configured : stdout and rolling file
log4j.rootLogger=INFO, STDOUT, ROLLING, jms

## Be sure that ActiveMQ messages are not logged to 'jms' appender
log4j.logger.org.apache.activemq=INFO, STDOUT

#
# ROLLING file appender 
#
log4j.appender.ROLLING=org.apache.log4j.RollingFileAppender
log4j.appender.ROLLING.File=jdaemon.log
log4j.appender.ROLLING.MaxFileSize=2MB
log4j.appender.ROLLING.MaxBackupIndex=10
log4j.appender.ROLLING.layout=org.apache.log4j.PatternLayout
log4j.appender.ROLLING.layout.ConversionPattern=${laser.conversion.pattern}
log4j.appender.ROLLING.Threshold=DEBUG

#
# Stdout appender
#
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=${laser.conversion.pattern}
log4j.appender.STDOUT.Threshold=DEBUG

#
# JMS appender
#
log4j.appender.jms=org.apache.log4j.net.JMSAppender
# log4j.appender.jms.layout=org.apache.log4j.HTMLLayout
# log4j.appender.jms.layout.ConversionPattern=${laser.conversion.pattern}
log4j.appender.jms.InitialContextFactoryName=org.apache.activemq.jndi.ActiveMQInitialContextFactory
log4j.appender.jms.ProviderURL=tcp://cs-ccr-spsea2:61670
log4j.appender.jms.TopicBindingName=logTopic
log4j.appender.jms.TopicConnectionFactoryBindingName=ConnectionFactory

also, the jndi.properties file is stated with -D options containing this :

topic.logTopic=logTopic


I'd appreciate any help on this !

Cheers,
Felix

-----
Felix Ehm,
www.cern.ch
-- 
View this message in context: http://old.nabble.com/Log4J-ActiveMQ-JMS-Appender-tp18840199p27547554.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Log4J ActiveMQ JMS Appender

Posted by Gary Tully <ga...@gmail.com>.
Great. glad u got sorted. Thanks for letting us know.

On 12 February 2010 18:00, fehm <Fe...@cern.ch> wrote:

>
> Hi Gary,
>
> thanks for the quick reply. In fact, my Broker was mis-configured. I
> started
> a Broker with the default config and it connects perfectly.
>
> You actually don't need to restrict the log level of activemq. You can
> leave
> it do DEBUG (and of course not using JMS appender).
> But you need to have the rootLogger at minimum INFO level. When using DEBUG
> for it the JMS appender doesn't work.
>
>
> Cheers,
> Felix
>
>
> -----
> Felix Ehm,
> www.cern.ch
> --
> View this message in context:
> http://old.nabble.com/Log4J-ActiveMQ-JMS-Appender-tp18840199p27567206.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Re: Log4J ActiveMQ JMS Appender

Posted by fehm <Fe...@cern.ch>.
Hi Gary,

thanks for the quick reply. In fact, my Broker was mis-configured. I started
a Broker with the default config and it connects perfectly.

You actually don't need to restrict the log level of activemq. You can leave
it do DEBUG (and of course not using JMS appender).
But you need to have the rootLogger at minimum INFO level. When using DEBUG
for it the JMS appender doesn't work.


Cheers,
Felix


-----
Felix Ehm,
www.cern.ch
-- 
View this message in context: http://old.nabble.com/Log4J-ActiveMQ-JMS-Appender-tp18840199p27567206.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Log4J ActiveMQ JMS Appender

Posted by Gary Tully <ga...@gmail.com>.
This is really down to log4j configuration.

## Be sure that ActiveMQ messages are not logged to 'jms' appender
log4j.logger.org.apache.activemq=INFO, STDOUT

should do it, unless it is picking up appenders from the rootlogger.

The problem is if any logging is produced during ActiveMQ connection
creation as part of the JMS appender, It cannot be written as there is a
lock pending appender initialization. Reducing ActiveMQ logging to FATAL
should ensure there is no such logging.

I wonder would the following help, restrict logging level more:
log4j.logger.org.apache.activemq=FATAL, STDOUT

or try and apply filter to *all* appenders:
log4j.logger.org.apache.activemq=INFO


On 11 February 2010 15:20, fehm <Fe...@cern.ch> wrote:

>
> Hi,
>
> although this topic seems to be outdated and I have read the documentation
> :
> is there a solution/hint to this issue ?
>
> Unfortunately, I'm experiencing the same with the following log4j config :
>
> laser.conversion.pattern=%d{HH:mm:ss} [%-20t] %-5p %-20c{1} ==> %m%n
> # two appenders have been configured : stdout and rolling file
> log4j.rootLogger=INFO, STDOUT, ROLLING, jms
>
> ## Be sure that ActiveMQ messages are not logged to 'jms' appender
> log4j.logger.org.apache.activemq=INFO, STDOUT
>
> #
> # ROLLING file appender
> #
> log4j.appender.ROLLING=org.apache.log4j.RollingFileAppender
> log4j.appender.ROLLING.File=jdaemon.log
> log4j.appender.ROLLING.MaxFileSize=2MB
> log4j.appender.ROLLING.MaxBackupIndex=10
> log4j.appender.ROLLING.layout=org.apache.log4j.PatternLayout
> log4j.appender.ROLLING.layout.ConversionPattern=${laser.conversion.pattern}
> log4j.appender.ROLLING.Threshold=DEBUG
>
> #
> # Stdout appender
> #
> log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
> log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
> log4j.appender.STDOUT.layout.ConversionPattern=${laser.conversion.pattern}
> log4j.appender.STDOUT.Threshold=DEBUG
>
> #
> # JMS appender
> #
> log4j.appender.jms=org.apache.log4j.net.JMSAppender
> # log4j.appender.jms.layout=org.apache.log4j.HTMLLayout
> # log4j.appender.jms.layout.ConversionPattern=${laser.conversion.pattern}
>
> log4j.appender.jms.InitialContextFactoryName=org.apache.activemq.jndi.ActiveMQInitialContextFactory
> log4j.appender.jms.ProviderURL=tcp://cs-ccr-spsea2:61670
> log4j.appender.jms.TopicBindingName=logTopic
> log4j.appender.jms.TopicConnectionFactoryBindingName=ConnectionFactory
>
> also, the jndi.properties file is stated with -D options containing this :
>
> topic.logTopic=logTopic
>
>
> I'd appreciate any help on this !
>
> Cheers,
> Felix
>
> -----
> Felix Ehm,
> www.cern.ch
> --
> View this message in context:
> http://old.nabble.com/Log4J-ActiveMQ-JMS-Appender-tp18840199p27547554.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com