Justin Lloyd asked,
| Is there a way to write to multiple logs? I want to write to a different log
| every day, but keep a monthly log as well. Something like daily_log and
| monthly_log, which will be moved by a script nightly.
|
| I thought about trying to write to a pipe, but that didn't work. Any
| suggestions?
Not an easy one. An instruction to append the daily log to the monthly log
in the TRAP statement will not have full information yet on the current
message and it will keep repeating information about today's earlier messages
again and again.
Next best thing: that nightly job that starts a new daily log can also append
the old daily log to the monthly log before deleting it. You will have only
one copy of a given message's log entry at a time, and the current day's ac-
tivity will be only in the daily log (the monthly log will have information
on mail processed from the beginning of the month through yesterday), but
that's about as close as we can come.
Alternatively, keep only the monthly log, but put some sort of marker in it
nightly that separates each day's log entries from the others so that, when
you read it, you can rapidly page down to where today's log entries start.
For example, put
::::: 01 :::::
at the start of the monthly log,
::::: 02 :::::
at the end of the first day's entries, and so forth. Then you can search
easily for the start of any given day's log entries.