Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Balancing Logging and Code Readability

by Illuminatus (Curate)
on Sep 14, 2009 at 16:27 UTC ( [id://795175]=note: print w/replies, xml ) Need Help??


in reply to Balancing Logging and Code Readability

It has always seemed to me that the 8-level priority scale of syslog makes it pretty easy to classify your logging. While levels 0-1 probably don't apply to most scripts (unless they are truly mission-critical), levels 2-7 are pretty self-explanatory. Levels 2-4 should all be for messages that report conditions that are known problems the script recognizes, and most likely require some action (or at least investigation). Levels 5-6 are for messages that report conditions that may or may not be problems (as far as you know). Analysis of consistent reporting of such conditions over time may warrant them being 'promoted' to a higher level. Level 7 is for 'everything else'. When you know you have a problem, but you also know that none of the other logging identifies the condition(s), copious level-7 logging of data and conditions that are currently assumed as 'always OK' is done, since at least one of these assumptions must be invalid (or some of the higher-level logging would catch it).

Unless there is a performance issue, lots of level-7 logging is almost never a bad thing. Since all log messages can be identified by severity, it is an easy thing to filter out this 'noise'.

fnord

  • Comment on Re: Balancing Logging and Code Readability

Replies are listed 'Best First'.
Re^2: Balancing Logging and Code Readability
by mickep76 (Beadle) on Oct 02, 2009 at 09:12 UTC

    I really like when people actually use syslog in custom inhouse solutions. But unfortunately it seems that most developers leans toward ease of implementation rather than ease of maintenance. I guess if you make a small project it makes sense not to log to syslog but if you make something that is in production and is critical to a production system it SHOULD use syslog.

    When using syslog it is ALOT easier to get all logs to a central location and actually filter them with tools like Swatch or Logwatch.

    I hope more developers could put on the system administrator's cape and learn the mantra re-use and NOT re-invent.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-19 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found