Opened 15 years ago

Closed 14 years ago

#221 closed enhancement (fixed)

Add date information to maintenance scripts to make logging more useful

Reported by: Ryan Delany Owned by: rjl
Priority: normal Milestone: 1.0.1
Component: Perl scripts Version:
Severity: normal Keywords: timestamp log logging


I configured all the maintenance scripts to log to my /var/log directory and append each time the scripts run so that I can keep an eye on how things are going. The only thing missing is that there is no date prepending each entry in the log.

Can we modify all the maintenance scripts to prepend a date to all output, using something like:

date +"%D %R"

I tried modifying the scripts myself, but I am no perl expert so it didn't come out the way I was hoping. Specifically I couldn't remove the line feed/carriage return from the output of the date command so my logs looked like this:

0 quarantined items expired 05/10/05 07:47 0 cached ham items expired

I would prefer they look like this:

05/10/05 07:47 0 quarantined items expired 05/10/05 07:47 0 cached ham items expired



Change History (3)

comment:1 Changed 15 years ago by Ryan Delany

The scripts I would like to see this feature added to: (even though this has no output, I would like to have a timestamp of each time it ran)

comment:2 Changed 14 years ago by rjl

  • Milestone set to 1.0.1
  • Status changed from new to assigned

comment:3 Changed 14 years ago by rjl

  • Keywords timestamp log logging added
  • Resolution set to fixed
  • Status changed from assigned to closed
  • Type changed from defect to enhancement

Added in [994]. The process-quarantine, expire-quarantine-cache, load-sa-rules, send-quarantine-reminders, send-quarantine-digests, and stats-snapshot scripts now prepend all of their output with a timestamp and script identifier, so that having these scripts append their output to a single log file (e.g. maia.log) is now practical.

Note: See TracTickets for help on using tickets.