Bug 4131 - format of messages when logging to a file
Summary: format of messages when logging to a file
Status: RESOLVED WONTFIX
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamc/spamd (show other bugs)
Version: 3.0.2
Hardware: All Linux
: P3 enhancement
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-10 10:02 UTC by Lawrence Akka
Modified: 2005-02-10 01:25 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Lawrence Akka 2005-02-10 10:02:59 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
    )
Comment 1 Malte S. Stretz 2005-02-10 10:25:15 UTC
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.