3 Replies Latest reply on May 11, 2004 6:05 AM by Hussein Badakhchani

    SyslogAppender for Application not working

    jmer Newbie

      Hi list;
      Im trying to point my Application log to syslog. Currently i define this on jboss-3.2.3 log4j.xml. jboss running on Linux box 9



      <param name= "Facility " value= "local6"/ >
      <param name= "FacilityPrinting " value= "true"/ >
      <param name= "SyslogHost " value= "localhost"/ >

      and


      <appender-ref ref="SmartSQL"/>


      on my Linux box i added "-r" on syslogd start/stop and added level6.* /var/log/test.log on syslog.conf. But when i restarted the server, test.log was created on /var/log.I called log4j via logger on my application


      Logger smartlog = Logger.getLogger("smart");


      but when i try to test my application on jboss, System out is showed on the console but no logs on test.log? am i missing something?


        • 1. Re: SyslogAppender for Application not working
          Hussein Badakhchani Newbie

          My log4j.xml entery


          < appende "SYS_LOG" class="org.apache.log4j.net.SyslogAppender">
          <param name="Facility" value="local2"/>
          <param name="SyslogHost" value="localhost"/>
          <param name="Threshold" value="info"/>
          <param name="FacilityPrinting" value="false"/>
          <layout class="org.apache.log4j.PatternLayout">
           <param name="ConversionPattern" value="[%-1p] %c %m%n"/>
          </layout>
          </appender>
          
          <root>
           <appender-ref ref="SYS_LOG"/>
          </root>
          
          


          In my case the sys_log is appended to the root, try this as a sanity test. Also make sure your threshold is low to capture all logging for testing purposes (debug)

          My syslog conf entery:

          # Save jboss messages to jboss.log
          local2.* /var/log/jboss.log
          


          /etc/sysconfig/syslog

          SYSLOGD_OPTIONS="-r -m 0"
          


          make sure you rerstart syslog

          • 2. Re: SyslogAppender for Application not working
            jmer Newbie

            here is my config, but still i get mo logs /var/log/smart.log

            log4j.xml:

            <appender name="SmartSQL" class="org.apache.log4j.net.SyslogAppender">
             <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
             <param name= "Facility " value= "local6"/ >
             <param name= "SyslogHost " value= "localhost"/ >
             <param name="Threshold" value="info"/>
             <param name= "FacilityPrinting " value= "true"/ >
             <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern" value="[%-1p] %c %m%n"/>
             </layout>
            </appender>

            <root>
             <appender-ref ref="SmartSQL"/>
             <appender-ref ref="CONSOLE"/>
            <appender-ref ref="FILE"/>
            </root>
            


            syslog.conf
            local6.* /var/log/smart.log
            


            /etc/rc.d/init/syslog:
            SYSLOGD_OPTIONS="-r -m 0"
            

            did i miss something?


            • 3. Re: SyslogAppender for Application not working
              Hussein Badakhchani Newbie

              As a sanity check try/answer the following

              1) Make sure your log file exists (touch /var/log/smart.log)
              2) Reduce your log threshold to debug
              3) Is syslog working for other applications?
              4) Try using logger or some other utility to log to local6, does it work?
              5) What is the extact logging code that you are using?

              hoos