I have long log messages to be passed through rsyslog
. The logs are being generated via syslogj
library that splits the logs into 1024 chars length chunks then sends them to rsyslog
(based on what's noted here) :
There some applications that do not ignore the RFC tho, log4j 1.2.15 is one of them (and probably later versions too). If the size of the message >= 1024 bytes, log4j will divide it and send 2 messages regardless of MTU.
AFAIK This has nothing to do with rsyslog, since we have already large logs from remote sources, and also setting $MaxMessageSize 64k
in /var/rsyslog.conf
didn't change anything.
How could we increase the message size in syslog4j
? There's a constant in org.productivity.java.syslog4j.SyslogConstants
class which denotes a 1024 size, but I'm not sure if it's related to my issue:
public static final int SYSLOG_BUFFER_SIZE = 1024;
Furthermore, didn't find any method for this job. (like the ones below)
SyslogIF syslogInstance;
syslogInstance = Syslog.getInstance("tcp");
syslogInstance.getConfig().setHost(host);
syslogInstance.getConfig().setPort(port);
P.s: This question apparently has a similar problem but neither mentioned it's via syslog4j
nor got any answer.