Bug 46271 - NullPointException from SyslogAppender
Summary: NullPointException from SyslogAppender
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Appender (show other bugs)
Version: 1.2
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: log4j-dev
: 47957 (view as bug list)
Depends on:
Reported: 2008-11-23 19:07 UTC by Chris
Modified: 2009-10-08 19:57 UTC (History)
1 user (show)


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)

    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. ***