cron log

Started by Ricardo, November 27, 2018, 01:11:17 PM

Previous topic - Next topic
Hello all,

I am trying to find the log that contains all the "cron" output, but I am unable to find it anywhere.

/var/log does not hold any file that contains the string "cron" as content. Also
1) system/settings/logging
2) system/settings/cron
neither contain option to activate such cron logging.

Can someone point me to any documentation about this topic?

Am I missing something obvious, or that question is really that impossible to answer?

/var/log/<something with the name "cron" in it> is indeed a valid file in normal freebsd, so my question cannot be that stupid.

I'm interested in the location of this log as well.

We do not have a cron log. For all the activities the log locations are System or Backend log.


Cheers,
Franco

Quote from: franco on December 16, 2018, 08:06:15 PM
We do not have a cron log. For all the activities the log locations are System or Backend log.


Cheers,
Franco

Is it intentional to not have log about cron activity? How can custom cron jobs be debugged, as I could not see any cron-related entry neither in System nor in Backend?

I would lie if I said this was intentional to be left out. But it's likely true that it was not implemented because it was never strictly required dating back to m0n0wall.

Not opposed to a cron log feature, but someone would have to write it and help deal with the "fallout" of both current and future scripting in this area.


Cheers,
Franco

I added this config for cron support (/usr/local/etc/syslog-ng.conf.d/syslog-ng-cron.conf):


filter f_cron { facility(cron); };

destination d_local_cron {
  file(
    "/var/log/cron/cron_${YEAR}${MONTH}${DAY}.log"
    create-dirs(yes)
    flags(syslog-protocol)
  );
};

log {
  source(s_all);
  filter(f_cron);
  destination(d_local_cron);
};


Unfortunately there's no way to add this to the application list for remote logging, so you ether have to add a duplicate destination or use the generated one by opnsense:


...
  destination(d_6bf9323eda944bbd9b28befeb8e2ce55);
...