crond log level meaning
The particular semantics of the log level values for crond
are only defined in the code, it seems. All of the crond
logging there goes through a crondlog()
function in busybox/miscutils/crond.c
function:
static void crondlog(unsigned level, const char *msg, va_list va)
{
if (level >= G.log_level) {
/* Do logging... */
So that only those messages with levels higher than the one you specify via the -l
command-line option are logged.
Then, elsewhere in that crond.c
file, we see that crondlog()
is only called via the log5()
, log7()
, and log8()
wrapper functions. Which means that those are the only levels at which that crond
program logs messages.
These log levels are specific to crond
, and are not related to any syslog(3)
levels or other programs. In short, the meaning of these levels is only found in the source code for this program.
I was doing some debugging on my Slackware 14.2 system and needed crond to be more informative. I downloaded the source code and went through it.
Summary of my crond -l #
testing:
-l 0
, -l 1
, -l 2
, ... worked ok up to -l 7
;
then it got unpredictable since there are only 7 logging levels.
The first four levels were pretty silent; they didn't log anything.
Summary of logging levels from crond main.c
:
-l emerg or panic LOG_EMERG 0 [* system is unusable *]
-l alert LOG_ALERT 1 [* action must be taken immediately *]
-l crit LOG_CRIT 2 [* critical conditions *]
-l error or err LOG_ERR 3 [* error conditions *]
-l warn or warning LOG_WARNING 4 [* warning conditions *]
-l notice LOG_NOTICE 5 [* normal but significant condition *] the default
-l info LOG_INFO 6 [* informational *]
-l debug LOG_DEBUG 7 [* debug-level messages *] same as -d option
Note:the higher the number, the more logging you will get from crond.
I run it with -l debug
now.