Truncated syslog messages
This is a surprisingly easy fix to a very irritating problem. My problem was just this: I'm using the system log (syslog/syslogd/logger) for things other than just system messages. If there's a long message, it will get the end chopped off. The log message is too short. This isn't working for me.
- This is pretty safe, but just in case: cp -p /usr/sbin/syslogd /usr/sbin/syslogd.bak
- cd /usr/src/usr.sbin/syslogd/
- vi syslogd.c
- find this line in that file (line 71 for me):
#define MAXLINE 1024 /* maximum line length */
... and change '1024' to the value you need (maybe 2048 or 4096). - make obj && make depend && make && make install
- /etc/rc.d/syslogd restart
That's it! You're now supporting longer syslog messages.
This trick is actually old hat. I've seen this problem a long time ago and was aware of this solution. But, I doubled-checked a web search, and I found that unless you already knew some key search terms (like "syslogd.c" or "MAXLINE"), you weren't going to get many useful results. So, I went ahead and wrote this.
Labels: servers