Bug 46271 - NullPointException from SyslogAppender
NullPointException from SyslogAppender
Status: RESOLVED FIXED
Product: Log4j
Classification: Unclassified
Component: Appender
1.2
PC Windows XP
: P2 normal
: ---
Assigned To: log4j-dev
:
: 47957 (view as bug list)
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2008-11-23 19:07 UTC by Chris
Modified: 2009-10-08 19:57 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris 2008-11-23 19:07:07 UTC
When no Layout is set for the SyslogAppender, every call to log generates a NullPointerException


Caused by: java.lang.NullPointerException
	at org.apache.log4j.net.SyslogAppender.append(SyslogAppender.java:312)
	at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
	at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
	at org.apache.log4j.Category.callAppenders(Category.java:206)
	at org.apache.log4j.Category.forcedLog(Category.java:391)
	at org.apache.log4j.Category.log(Category.java:856)
	at org.apache.commons.logging.impl.Log4JLogger.warn(Log4JLogger.java:222)


SyslogAppender.java:312
    String packet = layout.format(event);


The appender assume a layout will always be set and does not set a default if none is provided
Comment 1 Curt Arnold 2009-01-08 09:48:38 UTC
Committed change in rev 732771.
Comment 2 Curt Arnold 2009-10-08 19:57:13 UTC
*** Bug 47957 has been marked as a duplicate of this bug. ***