SA Bugzilla – Bug 4131
format of messages when logging to a file
Last modified: 2005-02-10 01:25:15 UTC
When logging to a file (e.g. with option "-s /var/log/filename") spamd produces lines like this: 2005-02-10 17:27:42 [19357] i: connection from localhost.localdomain [127.0.0.1] at port 40456 2005-02-10 17:27:42 [19357] i: checking message ... What is the "i:" for? It would be much more useful if the line inclluded the name of the generating process, eg spamd, for ease of identification when lines are logged to a logfile used also by other processes. How about changing the sprintf line in sub logmsg_file from this: sprintf( "%04d-%02d-%02d %02d:%02d:%02d [%s] %s: %s\n", @date, $$, 'i', $msg ) to this: sprintf( "%04d-%02d-%02d %02d:%02d:%02d [%s] %s: %s\n", @date, $$, 'spamd', $msg )
You must not use this feature to "share" a log file between two or more processes because that will create great havoc as spamd doesn't use any locking and keeps the logfile always opened. The log-to-file feature is currently a bit fragile, if you want to do more (including rotation) than simple appending to a logfile, you should probably log to stderr and feed that to a log handler which is a bit more forgiving. This feature is mostly used for our test framework. I think the timestamp was already removed from the 3.1 codebase because it clashed with some other logging tools. The "i: " stands for "information" btw -- currently spamd always uses the loglevel INFO, but there are plans to change that and such this part is some kind of upwards-compatibility. I close this as WONTFIX as adding the string "spamd" doesn't make much sense because of the first paragraph.