… | |
… | |
75 | numerical value". |
75 | numerical value". |
76 | |
76 | |
77 | Instead of specifying levels by name you can also specify them by aliases: |
77 | Instead of specifying levels by name you can also specify them by aliases: |
78 | |
78 | |
79 | LVL NAME SYSLOG PERL NOTE |
79 | LVL NAME SYSLOG PERL NOTE |
80 | 1 fatal emerg exit aborts program! |
80 | 1 fatal emerg exit system unusable, aborts program! |
81 | 2 alert |
81 | 2 alert failure in primary system |
82 | 3 critical crit |
82 | 3 critical crit failure in backup system |
83 | 4 error err die |
83 | 4 error err die non-urgent program errors, a bug |
84 | 5 warn warning |
84 | 5 warn warning possible problem, not necessarily error |
85 | 6 note notice |
85 | 6 note notice unusual conditions |
86 | 7 info |
86 | 7 info normal messages, no action required |
87 | 8 debug |
87 | 8 debug debugging messages for development |
88 | 9 trace |
88 | 9 trace copious tracing output |
89 | |
89 | |
90 | As you can see, some logging levels have multiple aliases - the first one |
90 | As you can see, some logging levels have multiple aliases - the first one |
91 | is the "official" name, the second one the "syslog" name (if it differs) |
91 | is the "official" name, the second one the "syslog" name (if it differs) |
92 | and the third one the "perl" name, suggesting (only!) that you log C<die> |
92 | and the third one the "perl" name, suggesting (only!) that you log C<die> |
93 | messages at C<error> priority. |
93 | messages at C<error> priority. The NOTE column tries to provide some |
|
|
94 | rationale on how to chose a logging level. |
|
|
95 | |
|
|
96 | As a rough guideline, levels 1..3 are primarily meant for users of |
|
|
97 | the program (admins, staff), and are the only logged to STDERR by |
|
|
98 | default. Levels 4..6 are meant for users and developers alike, while |
|
|
99 | levels 7..9 are usually meant for developers. |
94 | |
100 | |
95 | You can normally only log a single message at highest priority level |
101 | You can normally only log a single message at highest priority level |
96 | (C<1>, C<fatal>), because logging a fatal message will also quit the |
102 | (C<1>, C<fatal>), because logging a fatal message will also quit the |
97 | program - so use it sparingly :) |
103 | program - so use it sparingly :) |
98 | |
104 | |