I cannot find anywhere the log level meaning of crond
.
I know that 0 is pretty much "log everything" while 8 is "show only important info" thanks to the crond help:
/ # crond --help
BusyBox v1.26.2 (2017-11-23 08:40:54 GMT) multi-call binary.
Usage: crond -fbS -l N -d N -L LOGFILE -c DIR
-f Foreground
-b Background (default)
-S Log to syslog (default)
-l N Set log level. Most verbose:0, default:8
-d N Set log level, log to stderr
-L FILE Log to FILE
-c DIR Cron dir. Default:/var/spool/cron/crontabs
but where I can find exactly the documentation/meaning about the different levels?
I'm on Alpine 3.6.
Best Answer
The particular semantics of the log level values for
crond
are only defined in the code, it seems. All of thecrond
logging there goes through acrondlog()
function inbusybox/miscutils/crond.c
function: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 thatcrondlog()
is only called via thelog5()
,log7()
, andlog8()
wrapper functions. Which means that those are the only levels at which thatcrond
program logs messages.These log levels are specific to
crond
, and are not related to anysyslog(3)
levels or other programs. In short, the meaning of these levels is only found in the source code for this program.