5 Replies Latest reply on Oct 6, 2010 1:09 PM by niefeng

    Enable logging in Gossip Router

    niefeng

      Hi all,

       

      I am using Gossip router in my cluster setup. Is it possible to enable some form of logging in the gossip router like observing which node join the cluster, which node left the cluster?

       

       

      I start up the gossip router via the cmd below

       

      java -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

       

      Thanks

      NieFeng

        • 1. Re: Enable logging in Gossip Router
          belaban

          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

            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

              The -Dlog4j.configuration system property needs a URL for some obscure reason, e.g. -Dlog4j.configuration=file:/home/user/log4j.properties

              1 of 1 people found this helpful
              • 4. Re: Enable logging in Gossip Router
                niefeng

                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

                  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