procmail
[Top] [All Lists]

Re: Procmail Logging -- Making it start new line..

2002-02-14 14:55:54
Scott Palmer asked,

| My log line looks like this example:
|
| LOG=" -- Logging -- RULE=CRON FAILURE, MSGID=$MESSAGE_ID .... "
|
| It logs just fine, however each log entry follows the next instead of
| starting a new line.

There are two basic approaches to close $LOG with a newline.

One is to include the trailing newline in the string you assign to $LOG, as
in

LOG=" -- Logging -- RULE=CRON FAILURE, MSGID=$MESSAGE_ID ....
"

The other is to assign a variable early in your rcfile (NL is a common name
for it among those who take this tack) to contain one newline:

NL="
"

and to use it thereafter:

LOG=" -- Logging -- RULE=CRON FAILURE, MSGID=$MESSAGE_ID ....$NL"

If an assignment to $LOG automatically added a closing newline, there would
be no way to build up entries on a single line and write them as they're
determined instead of having to save them up for a single entry when you're
positive they're all done.  This way we have both options.



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>