Bug 42087 - log4j.appender.syslog does not limit syslog lines to 1024 chars
log4j.appender.syslog does not limit syslog lines to 1024 chars
Status: RESOLVED FIXED
Product: Log4j
Classification: Unclassified
Component: Appender
1.2
Other other
: P2 major
: ---
Assigned To: log4j-dev
:
Depends on:
Blocks:
  Show dependency tree
 
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.