procmail
[Top] [All Lists]

Re: Log file interleaving, was: Determining a message's size in Procmail

2006-12-12 17:19:47
At 18:14 2006-12-12 -0500, Patrick Shanahan wrote:
* Ruud H.G. van Tol <rvtol(_at_)isolution(_dot_)nl> [12-12-06 17:52]:
I was talking about a single assignment to LOG. If there are more
  LOG = "blahblah"
occurences, then they can get interleaved by other procmail processes.
That is why I use a $ToLOG that I append to, and only at delivery I do
   LOG = $ToLOG

Please explain this (in layman terms :^) ).  I frequently observe
mixing data in the $LOGFILE.


the file is but one file, and procmail doesn't LOCK the logfile at the 
beginning of each message it processes, nor does it internally buffer the 
output to the file (say, dumping it to the log as it exits).  Since you can 
recieve and process several messages concurrently, the log regerences 
emitted by each of those invocations can be emitted to the logfile WHILE 
THE OTHER PROCMAIL PROCESSES ARE RUNNING.

I suggest you examine your system logs or webserver logs if you have an 
issue with how procmail is logging.  The various lines of logs associated 
with an SMTP event for instance don't all appear adjacent to one another if 
there are several messages in (or out) at the same time.  An HTTP page 
request involves making multiple requests - one for each element on the 
page, and if there are other HTTP downloads at the same time, you can be 
assured that they're interleaved with one another.

It certainly would be nice if procmail logging sported a timestamp option 
where the lines were prefixed with a timestamp and procmail processid, 
since they could readily be filtered when examining the file.

---
  Sean B. Straw / Professional Software Engineering

  Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
  Please DO NOT carbon me on list replies.  I'll get my copy from the list.


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail