0

syslogd daemon based on busybox allows this arguments on startup script:

-s SIZE         Max size (KB) before rotation (default 200KB, 0=off)
-b N            N rotated logs to keep (default 1, max 99, 0=purge)

For example:

$ syslogd -n -s 10240 -b 3

allows /var/log/messages being rotated "3" times, creating backup files of 10MB locally before starting the rotation process (deleting oldest files):

/var/log/messages
/var/log/messages.0
/var/log/messages.1
/var/log/messages.2

I would like to emulate this syslogd rotation behaviour (creating the /var/log/messages.X files locally) but using rsyslog (with new object oriented syntax) instead of syslogd. Is this possible? I was reading documentation but haven't found nothing useful.

aicastell
  • 2,182
  • 2
  • 21
  • 33
  • 1
    Yes, this is possible. See [Enable log rotation in rsyslog](https://stackoverflow.com/questions/72095695/enable-log-rotation-in-rsyslog/72123943#72123943) – eDonkey Jul 12 '22 at 12:31
  • Yes, option (1) pointed in this link is helpful, as it can be used to solve my issue. Thank you for pointing in the right direction!. BUT... this solution is using old rsyslog syntax. And I would like to know if getting the same result is possible using the newer object oriented (2) syntax. – aicastell Jul 12 '22 at 14:25
  • 1
    No, sadly the option posted in the answer is using the *latest* syntax that can be used for output channels. It has stayed the same since v6 (currently at v8). – eDonkey Jul 13 '22 at 06:37
  • 1
    Good to know. If you like, publish your comment as answer to this question, and I will accept it as the valid answer. Thank you for your time! – aicastell Jul 13 '22 at 06:41

0 Answers0