Logwatch on FreeBSD


No, this isn't a guide for Logwatch.

I could never find the correct location for the Logwatch configuration on FreeBSD. I found that several "guides" said to modify /usr/local/etc/logwatch/defaults/logwatch.conf, but that is NOT the correct thing to do. You aren't supposed to change that file in the first place, and any updates to Logwatch will overwrite it. (Example site from 2008)

The HOWTO and README files for the FreeBSD Logwatch tell you to use /etc/logwatch. That is also incorrect. The FreeBSD version of Logwatch never even checks that directory.

For making changes to Logwatch on FreeBSD, create & edit this file:

/usr/local/etc/logwatch/logwatch.conf

When I do a Google search for that file, Google tells me "no results found" for that.

Really?

Not one mention of the config location in any guide, forum post, document, readme, source comment, howto, man page, etc?


On my systems, I make sure the proper directory exists, and I copy the default files to it:

mkdir -p /usr/local/etc/logwatch/services

cp /usr/local/etc/logwatch/defaults/logwatch.conf /usr/local/etc/logwatch/

cp /usr/local/etc/logwatch/defaults/services/zz-disk_space.conf /usr/local/etc/logwatch/services/

Then I make any changes I want.

For example, in /usr/local/etc/logwatch/logwatch.conf, I change these two options:

Detail = Med
Output = mail

And then in /usr/local/etc/logwatch/services/zz-disk_space.conf, I add this so it displays storage size human-readable, and excludes virtual file systems:

$df_options = "-h -T -t nodevfs,linprocfs,linsysfs,tmpfs"