#989242 please write your own logfile

Package:
logrotate
Source:
logrotate
Description:
Log rotation utility
Submitter:
Harald Dunkel
Date:
2021-06-01 19:27:03 UTC
Severity:
wishlist
#989242#5
Date:
2021-05-30 05:35:24 UTC
From:
To:
Would you mind to enable logrotate logging for Bookworm by default?
logrotate appears to be excellent in logging. Its a shame that this
is not used. And since you have to wait 24h for the next run (unless
you enable hourly rotation) it is even more painful to have no log
when you need it.

This would be very helpful to catch unwanted config files in logrotate.d,
not caught by tabooext, for example.
--- /lib/systemd/system/logrotate.service       2020-08-21 15:02:38.000000000 +0200
+++ /etc/systemd/system/logrotate.service       2021-05-30 06:48:42.743903674 +0200
@@ -6,7 +6,7 @@

  [Service]
  Type=oneshot
-ExecStart=/usr/sbin/logrotate /etc/logrotate.conf
+ExecStart=/usr/sbin/logrotate -l /var/log/logrotate.log /etc/logrotate.conf

  # performance options
  Nice=19


The cron script should be modified accordingly (not shown here).


Thanx in advance

Harri

#989242#10
Date:
2021-06-01 19:22:48 UTC
From:
To:
Am So., 30. Mai 2021 um 07:39 Uhr schrieb Harald Dunkel <harri@afaics.de>:

By default logrotate logs with normal priority to stderr, which should
be captured by callers, e.g. cron or systemd.
When logging to a file logrotate does also issue debug messages, which
might be the lines you are referring to.

I am not sure though if enabling debug logging by default is the way to go.

If you want to check what would happen on rotation after configuration
changes, you can run `logrotate -vfd /etc/logrotate.conf`.
This will not rotate any file but should print every message you might need.

As an alternative `ExecStart=/usr/sbin/logrotate -v
/etc/logrotate.conf` could be used to forward all debug messages the
journal.