Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-3574

Log4j1ConfigurationParser fails to parse SyslogAppender

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.18.0
    • None
    • Log4j 1.2 bridge

    Description

      WARN StatusLogger Log4j 1 configuration parser: Unknown appender class: org.apache.log4j.net.SyslogAppender; ignoring appender: SYSLOG

      log4j.properties

       

      log4j.logger.com.test.util=DEBUG, JTAPI_ERROR_APPENDER, SYSLOG
      log4j.additivity.com.avaya.jtapi=false
      
      log4j.appender.SYSLOG=org.apache.log4j.net.SyslogAppender log4j.appender.SYSLOG.Threshold=FINEST#org.apache.log4j.helpers.UtilLoggingLevel log4j.appender.SYSLOG.SyslogHost=localhost log4j.appender.SYSLOG.Header=true log4j.appender.SYSLOG.protocol=UDP log4j.appender.SYSLOG.Facility=local0 log4j.appender.SYSLOG.layout=org.apache.log4j.PatternLayout log4j.appender.SYSLOG.layout.ConversionPattern=DmccMain[%pid] :%t: %c %-4p - %m%n
      
      
               try {
                  input = new FileInputStream(filePath);
                  final ConfigurationBuilder<BuiltConfiguration> builder = new Log4j1ConfigurationParser().buildConfigurationBuilder(input);
                       

      Log4j1ConfigurationParser.java

      
          private void buildAppender(final String appenderName, final String appenderClass) {
              switch (appenderClass) {
              case "org.apache.log4j.ConsoleAppender":
                  buildConsoleAppender(appenderName);
                  break;
              case "org.apache.log4j.FileAppender":
                  buildFileAppender(appenderName);
                  break;
              case "org.apache.log4j.DailyRollingFileAppender":
                  buildDailyRollingFileAppender(appenderName);
                  break;
              case "org.apache.log4j.RollingFileAppender":
                  buildRollingFileAppender(appenderName);
                  break;
              case "org.apache.log4j.varia.NullAppender":
                  buildNullAppender(appenderName);
                  break;
              default:
                  reportWarning("Unknown appender class: " + appenderClass + "; ignoring appender: " + appenderName);
              }
          } 

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            TukeshK Tukesh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: