Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Defensive Programming and Audit Trails

by Jenda (Abbot)
on Aug 09, 2002 at 14:50 UTC ( [id://188922]=note: print w/replies, xml ) Need Help??


in reply to Defensive Programming and Audit Trails

Seems we all agree. Strange ... ;-)

I would suggest one more thing ... before you archive or send to yourself the logs ... process them with a script that'll strip out the repetitive "Everything's OK" messages and similar things. Eg. pretty much all my services/daemons "tick", they write once a minute or whatever the interval is set to a message that just means "I'm still alive and ticking, there's nothing to do for me." I want this info to be sure the service did not get stuck. Once a day I move all log files to archive, replace the groups of "ticks" with simple "Ticking $Since - $To", zip everything up and both archive on the server and mail to me. I also include some info about the log files and the environment to the body of the emails.

The script that "polishes" the log files can (should) parse the logs and add to the message body the number of processed tasks and (more important) the number of suspicious or errorneous messages.

This way you may be the first who knows about a problem and you may fix it before anyone else notices ;-)

Jenda

Replies are listed 'Best First'.
Re(2): Defensive Programming and Audit Trails
by FoxtrotUniform (Prior) on Aug 09, 2002 at 15:29 UTC
      Seems we all agree. Strange ... ;-)

    I didn't exactly expect that to be a controversial node. The problem is, I keep running into people who just don't think about logging program status, or error conditions, or emitting any sort of status info at all... those are the people I wrote the node for.

    On the subject of notification: cron(8) will mail any output to you (well, to $MAILTO) after each cron job. I imagine other similar facilities exist elsewhere. Provided you don't get mail from your crons on a regular basis ("Hey! I completed successfully! Isn't that great?"), mail from cron(8) is an effective error-reporting facility; you don't have to wait until an error-checking/log polishing script runs at some time in the future, you know right away when the job finishes. (Or at least the next time you check your mail.)

    --
    F o x t r o t U n i f o r m
    Found a typo in this node? /msg me
    The hell with paco, vote for Erudil!

      The success mail is fine if there are two or three tasks a day. Not if there are tens and hundreds. I don't want to spam myself ;-)

      I guess this is the worst problem of logging and error reporting ... you either have too few or too much. But never just as much as you want ;-)

      Jenda

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://188922]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2024-03-29 00:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found