activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <gary.tu...@gmail.com>
Subject Re: Logging with ActiveMQ and Log4j
Date Mon, 28 Mar 2011 18:50:38 GMT
add -Dlog4j.debug to your jvm start command to see where log4j is
picking up its configuration. It may be that another properties file
is providing the log4j configuration.

On 28 March 2011 14:27, Oli <olafur.eiriksson@postea.com> wrote:
> Hello.
>
> I am currently developing a java project that is using ActiveMQ. I want to
> capture the output from the ActiveMQ classes (e.g. the connector starting,
> connections made and lost, messages sent and received) for logging purposes.
> I am using Log4J as my logging tool in the application.
>
> I can not seem to find a way to capture the output and log it to file.
> Adding log4j.properties to my project allows me to create a log file, but no
> output is sent to the file.
>
> This is my current log4j.properties file:
>
> log4j.rootLogger=info, debug, logfile
>
> # Or for more fine grained debug logging uncomment one of these
> log4j.logger.org.apache.activemq=ALL
> log4j.logger.org.apache.camel=ALL
>
> # File appender
> log4j.appender.logfile=org.apache.log4j.RollingFileAppender
> log4j.appender.logfile.file="My_directory"/logs/activemq.log
> log4j.appender.logfile.maxFileSize=1024KB
> log4j.appender.logfile.maxBackupIndex=5
> log4j.appender.logfile.append=true
> log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
> log4j.appender.logfile.layout.ConversionPattern=%d | %-5p | %m | %c | %t%n
>
> Using this example, a log file is created (the activemq.log file), but
> nothing gets written to it.
>
> I am also using a Log4j Logger instance in my code for general logging,
> which works fine.
>
> Is there anything I need to do in code to "activate" the logging so it can
> be written out to file? Are there any changes that I need to make to the
> log4j.properties file?
>
> I am using activemq v. 5.4.2 and log4j 1.2.16 and my project is in NetBeans.
>
> Any help would be appreciated.
>
> Oli
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Logging-with-ActiveMQ-and-Log4j-tp3411709p3411709.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
http://blog.garytully.com
http://fusesource.com

Mime
View raw message