Zygo / bees

Best-Effort Extent-Same, a btrfs dedupe agent
GNU General Public License v3.0
647 stars 55 forks source link

beesd flooding syslog #154

Open henfri opened 3 years ago

henfri commented 3 years ago

Hello,

I am using beesd with standard settings in beesd.conf. This is really flooding my syslog (500MB per day, rather than usually 5MB).

Wouldn't it make sense to have the default log-level less verbose?

Regards, Hendrik

kakra commented 3 years ago

I'm running with --verbose=5 which is probably "good enough" as a default...

samywee commented 3 years ago

To avoid unnecessary logging to syslog, is it possible to send logs to separate file rather than syslog? Where do we change the settings to do that? Can someone help? That will be useful?

kakra commented 3 years ago

How do you start beesd?

samywee commented 3 years ago

How do you start beesd?

Using systemctl on linux;

systemctl start beesd@

kakra commented 3 years ago

Okay, so logging is sent to the journal in the first place, not syslog. You can control the logging retention through journald.conf. systemd-journald comes with sane defaults. However, your distribution may have decided to mirror all journal entries to syslog. In this case, you can edit the bees service file to log to a different syslog facility, then configure your syslogger to write this facility to a different file.

Here's some hint to get started: https://unix.stackexchange.com/a/513396/2035

And here's another one on how to redirect service console output to a file: https://unix.stackexchange.com/a/479671/2035

The latter solution won't allow to rotate or truncate logs, however, you could restart the service to overwrite the log file, or you use append: instead. (man systemd.exec, StandardOutput/StandardError)

I'd recommend letting the bees service log to journal only (StandardOutput=journal). With this, easy storage and retention rules are in place, and you can look at it using journalctl -et beesd. You can use systemctl show beesd@... to find the current values for these options.