[logback-dev] [Bug 147] New: ch.qos.logback.classic.net.SyslogAppender fail with NullPointerException

bugzilla-daemon at pixie.qos.ch bugzilla-daemon at pixie.qos.ch
Thu Apr 17 07:21:17 CEST 2008


http://bugzilla.qos.ch/show_bug.cgi?id=147

           Summary: ch.qos.logback.classic.net.SyslogAppender fail with
                    NullPointerException
           Product: logback-classic
           Version: unspecified
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Other
        AssignedTo: logback-dev at qos.ch
        ReportedBy: rybin.andrey+logback at gmail.com


Joran shows no error in conf file, but SyslogAppender failed with
NullPointerException (because prefixLayout == null).

I think Joran should show a error or SyslogAppender should work.

conf, java and log below:


conf:
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true">
  <appender name="aSYSLOG" class="ch.qos.logback.classic.net.SyslogAppender">
    <SyslogHost>127.0.0.1</SyslogHost>
    <Facility>LOCAL7</Facility>
    <layout class="ch.qos.logback.classic.PatternLayout">
      <pattern>%d %p [%t] %c::%m%n</pattern>
    </layout>
  </appender>
  <root>
    <level value="TRACE"/>
    <appender-ref ref="aSYSLOG"/>
  </root>
</configuration>

java:
public static void main(String[] a) {
    org.slf4j.Logger log =
org.slf4j.LoggerFactory.getLogger(TestLogback.class);
    log.warn("test");
   
ch.qos.logback.classic.util.LoggerStatusPrinter.printStatusInDefaultContext();
  }//main

log:
11:09:10,687 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About
to instantiate appender of type [ch.qos.logback.classic.net.SyslogAppender]
11:09:10,687 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming
appender as [aSYSLOG]
11:09:10,796 |-INFO in ch.qos.logback.core.joran.action.AppenderAction -
Popping appender named [aSYSLOG] from the object stack
11:09:10,796 |-INFO in ch.qos.logback.classic.joran.action.LevelAction - root
level set to TRACE
11:09:10,796 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction -
Attaching appender named [aSYSLOG] to Logger[root]
11:09:10,796 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction
- End of configuration.
11:09:10,796 |-ERROR in ch.qos.logback.classic.net.SyslogAppender[aSYSLOG] -
Appender [aSYSLOG] failed to append. java.lang.NullPointerException
java.lang.NullPointerException
        at
ch.qos.logback.classic.net.SyslogAppender.postProcess(SyslogAppender.java:81)
        at
ch.qos.logback.core.net.SyslogAppenderBase.append(SyslogAppenderBase.java:62)
        at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:81)
        at
ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51)
        at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:282)
        at ch.qos.logback.classic.Logger.callAppenders(Logger.java:266)
        at
ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:487)
        at ch.qos.logback.classic.Logger.filterAndLog(Logger.java:479)
        at ch.qos.logback.classic.Logger.warn(Logger.java:712)
        at net.sf.apr.test.logback.TestLogback.main(TestLogback.java:7)


-- 
Configure bugmail: http://bugzilla.qos.ch/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the logback-dev mailing list