|My question is: what guidelines you have used for determining what is logged at each debug level?
I've built logging into several enterprise systems to support diagnosis in the field, and have always used simple numeric levels. It's a lot more convenient to write
log("diagnostic stuff") if $DEBUG > 1;
(or the equivalent from Log::Dispatch::Config) than it is to wrestle with symbolic names for levels.
Stay simple, and don't get too hung up with a rigid numbering schemes. I've gotten a lot of mileage out of the following:
- Level 1 - all user input (clicks, gestures, text input)
- Level 2 - "i'm here" from significant subroutines, plus any SQL queries that get executed
- Level 3 - diagnostic info from significant algorithms, plus summarized results of any SQL queries
- Level 4 - kitchen sink
All warning and error messages go into the log, unconditionally.
Each log message is timestamped. That provides a cheap way of doing performance profiling.
95% of the time, turning on level 1 has been sufficient to gather enough info to reproduce the problem locally, if not make it glaringly evident just what had gone off the rails and why. It's amazing how hard it is to believe that users will try certain sequences of actions, or that certain sequence are even possible, until you see hard evidence in the logs.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||