RFC3164 states in 4.1.3 "MSG Part of a syslog Packet":
The MSG part will fill the remainder of the syslog packet.
...
There is no ending delimiter to this part.
Some implementations do not follow this.
} else
{ die "unrecognized syslog message format (newer version?):\n $_" }
+ # Some messages may have a trailing newline, while others do not. The
+ # syslog RFCs state that end-of-message is end-of-datagram and any octet
+ # is allowed in the message, but Sys::Syslog seems to append a NUL.
+ $MSG =~ s/[\s\r\n\0]+$//; # remove trailing whitespace, newline, and nulls
+
print LoggerOutput $PRI,
join(' ', 1, $TIMESTAMP, $HOSTNAME, $APPNAME, $PROCID, $MSGID,
$SDAT, $MSG),"\n";