Bug 42087 - log4j.appender.syslog does not limit syslog lines to 1024 chars
Summary: log4j.appender.syslog does not limit syslog lines to 1024 chars
Status: RESOLVED FIXED
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Appender (show other bugs)
Version: 1.2
Hardware: Other other
: P2 major
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-11 04:03 UTC by Holger
Modified: 2007-04-21 08:28 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Holger 2007-04-11 04:03:54 UTC
logging-log4j-1.2.14.tar.gz

according to RFC 3164, the total length of the packet must be 1024 bytes or less.
When you log lines longer than this with the syslog appender, the trailing chars
are lost. I would see this as major bug because of data loss.
Comment 1 Curt Arnold 2007-04-21 00:13:13 UTC
Committed change in rev 530990.  

If character count on message exceeds 256, then byte count is checked and
message is successively halved with added "..." until each packet is less than
1024 bytes.

Added SyslogAppenderTest.testBigPackets to confirm that message is properly split.
Comment 2 Curt Arnold 2007-04-21 08:28:27 UTC
Made another modification in rev 531049.  I hadn't allowed for the 3-5
characters in the PRI section that would be added later when checking if total
package would exceed 1024 bytes.  Also simplified "fixed" part of continuations
and no longer include the facility name.  Changed behavior is consistent with
stack traces which do not repeat the facility name either.