-
1. Re: Enable logging in Gossip Router
belaban Sep 23, 2010 8:35 AM (in response to niefeng)Yes, you need to add a line to your log4j.properties file (see below) and start the GossipRouter with -Dlog4j.configuration=file:/home/user/log4j.properties:
---- log4j.properties -----
log4j.logger.org.jgroups.stack.GossipRouter=TRACE
-
2. Re: Enable logging in Gossip Router
niefeng Sep 24, 2010 8:34 AM (in response to belaban)Hi Bela,
Thanks for your quick reply. I included the log4j system properties as you suggested, but there is no log generated in the directory i specified. I have changed the startup script for the gossip router as follow.
java -Dlog4j.configuration=log4j.properties -cp antlr.jar:jgroups.jar:commons-logging.jar:/home/jboss/jboss-4.2.3.GA/lib/concurrent.jar org.jgroups.stack.GossipRouter -port 5555 -bindaddress 172.20.31.111
my log4j.properties look like below
log4j.rootLogger=TRACE, H
log4j.logger.org.jgroups.stack.GossipRouter=TRACE,H
log4j.appender.H = org.apache.log4j.RollingFileAppender
log4j.appender.H.File = /home/jboss/gossipLog.log
log4j.appender.H.MaxFileSize = 100KB
log4j.appender.H.layout = org.apache.log4j.PatternLayout
log4j.appender.H.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n
The Jboss i am using is JBOSS AS 4.2.3.
Thanks for your help.
-
3. Re: Enable logging in Gossip Router
belaban Sep 24, 2010 8:37 AM (in response to niefeng)1 of 1 people found this helpfulThe -Dlog4j.configuration system property needs a URL for some obscure reason, e.g. -Dlog4j.configuration=file:/home/user/log4j.properties
-
4. Re: Enable logging in Gossip Router
niefeng Sep 24, 2010 8:46 AM (in response to belaban)Hi Bela,
Thanks for the reply.
I have tried to include the URL (file:/home/jboss/log4j.properties) as you mentioned, but no log get generated as well.
Thanks
-
5. Re: Enable logging in Gossip Router
niefeng Oct 6, 2010 1:09 PM (in response to niefeng)It is my mistake that i do not include log4j.jar as part of the classpath. The followng is the working cmd
java -Dlog4j.configuration=file:/home/jboss/log4j.properties -cp antlr.jar:jgroups.jar:commons-logging.jar:/home/jboss/jboss-4.2.3.GA/lib/concurrent.jar:log4j.jar org.jgroups.stack.GossipRouter -port 5555 -bindaddress 172.20.31.111
NieFeng