> man cron, tells me that the default log level for cron is 1; i.e. cron "will log the start of all cron jobs."
I want to set that to 7, so I checked in all the wrong places, starting with the file /etc/syslog.d/50-default.conf. I am running Trusty 14.04.
Pointers anyone ?
Asked
Active
Viewed 6,150 times
2
Cbhihe
- 2,731
- 3
- 24
- 47
-
For 16.04 and systemd I could only get [this](http://serverfault.com/questions/740499/reduce-cron-log-level-with-systemd) method to work, even though `/etc/default/cron` says "This file has been deprecated". – Doug Smythies Dec 07 '16 at 16:27
-
btw, in 16.04 the 50-default.conf file is crucial if you want to break out system.log to also produce a separate cron.log, as per https://askubuntu.com/questions/966194/16-04-how-do-i-make-cron-create-its-own-log-file-so-it-can-be-monitored-in-real – SDsolar Oct 21 '17 at 07:01
2 Answers
5
You can edit the cron init script (/etc/init/cron.conf) as follow:
# cron - regular background program processing daemon
#
# cron is a standard UNIX program that runs user-specified programs at
# periodic scheduled times
description "regular background program processing daemon"
start on runlevel [2345]
stop on runlevel [!2345]
expect fork
respawn
exec cron -L 7
Sylvain Pineau
- 61,564
- 18
- 149
- 183
-
This is the old way that worked up until a FRESH install of 16.04 LTS. Upgrades from 14.04 to 16.04 still work this way, however. Same with using `service cron restart` - works fine until a 16.04 FRESH install. – SDsolar Oct 21 '17 at 06:58
0
Or if your installation doesn't have the /etc/init/cron.conf file, then edit the /etc/init.d/cron file by adding:-
EXTRA_OPTS="-L 0"
in the parameters section.
Dallas Clarke
- 101
- 1