Don Hammond wrote:
Philip's suggestion to log a single line, ...
That was one idea, but seemed like a LOT of work.
and Bart Schaefer's idea to leave concatenation to a different and less
frequent process ...
That was another idea that I was thinking about.
are probably better than what follows. But if Michael wants logging in
one reasonably human-readable logfile, maybe this can work.
Hmmm...
I assign a LOGPFX variable that includes PID ($$) for each message.
Every LOG="..." is then LOG="$LOGPFX ...".
Hmmm.
% man date
% man 3 strftime
Aha!
How about this (which I'm gonna try):
EPOCHSECONDS=`date +"%s"`
LOGPREFIX=$EPOCHSECONDS.$$
That should leave logprefix looking something like:
1027708364.1234
I think I could sort on that easily enough.
... except for the LOGABSTRACT.
Yeah.
He could prepend a unique prefix to each log write, and create a
custom LOGABSTRACT that did the same,
Probably best to set LOGABSTRACT to 'no', emit the Subject line myself
('cause I already emit the From: line), and then use TRAP to emit the
LASTFOLDER variable, plus a blank line (for most-of-the-time readability).
Hmmm. 'This Could Work...'.
TRAP='echo "$LOGPREFIX Folder: $LASTFOLDER"'
One minor problem is those nice, multi-line variables that I'm using
nowadays, but most of you probably won't have that problem. Oh well.
then it wouldn't matter if log lines from different messages are
interspersed. If it's important to keep error messages and "procmail:
..." log entries ordered, then this won't work perfectly. But it seems
that's not an issue here.
sort
Aloha mai Nai`a!
--
"Please have your Internet License http://kapu.net/~mjwise/
and Usenet Registration handy..."
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail