On Fri, 2002-09-13 at 12:51, Syed Qutubuddin Ahmad wrote:
[snip ]
>   thanks for help. the commands you suggested will be great for me. But i
> move logfiles periodically at another machine which may not be necessarily
> a linux machine(can be windows :( ), plus daemontools might not be
> installed on it. Also my supervisor needs to view logfiles himself
> sometimes, and he wants human readable time stamps.:(:(.
>   Thats why i still need some method to write human readable timestamps in
> logfiles directly..
[snip]

How about a scriptlet like

<collect logs>
# expand service log files
LOG=/var/log/daemontools

# log file for unattended operations
exec >>/var/log/cron-daily.log 2>&1

mkdir -p $LOG
for svcdir in /service/*
do
  svc=`basename $svcdir`
  log=$LOG/$svc.log

  savelog -t $log
  for logfile in $svcdir/log/main/@* /var/log/svscan/@*
  do
     [ -f $logfile ] || continue
     # insert service-tag and expand time stamp
     sed 's? ?'" $svc: "'?' $logfile | tai64nlocal >>$log
     rm -f $logfile
  done
done
</collect logs>

I use it once a day,  have my logfile parser will analyze the 
expanded results. A similar appoach would do with a remote machine.

So the size of the log files are still under control of "multilog"
while the human readable form appears as bulk data in the directory
/var/log/daemontools ready for further processing.

As I am lazy, I use "savelog" to control the amount of data in the
bulk directory.  This restricts the number of files (and compresses
the older ones) in the backlog.

jordan


Reply via email to