Page MenuHomeVyOS Platform

syslog freezes when file size reaches 512KB
Closed, ResolvedPublicBUG

Description

If the default syslog size is modified, syslog (/var/log/messages) will sometimes freeze when the file size reaches 512KB. The issue seems to be a discrepancy between the rsyslog max file size and the configuration applied to the vyos log rotator.

set system logs logrotate messages max-size '10'
set system logs logrotate messages rotate '10'

With this configuration I expect log files to grow to 10MB. However, they stop at 512KB and never rotate. /var/run/rsyslog/rsyslog.conf seems to not be modified correctly and contains a static limit of 512KB for /var/log/messages

...snip...
if prifilt("*.info,local7.debug") then {
    action(
        type="omfile"
        file="/var/log/messages"
        rotation.sizeLimit="524288" # 512Kib - maximum filesize before rotation
        rotation.sizeLimitCommand="/usr/sbin/logrotate /etc/logrotate.d/vyos-rsyslog"
    )
}
...snip...

To match my configuration, I changed rotation.sizeLimit = 10496000, restarted rsyslogd, and I've had no issues with logging since.

Details

Version
1.5-stream-2025-Q2
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

Viacheslav changed the subtype of this task from "Task" to "Bug".Aug 26 2025, 1:43 PM

I don't have any thoughts on how to fix this. The config templates don't seem to match the intent of the CLI, so perhaps I'm not understanding how the templates are used.

https://github.com/vyos/vyos-1x/blob/current/data/templates/rsyslog/rsyslog.conf.j2 clearly defines the max size for /var/log/messages statically as 512KB
https://github.com/vyos/vyos-1x/blob/current/data/templates/rsyslog/logrotate.j2 clearly defines the max size for /var/log/messages statically as 256k and oddly enough only considers /var/log/user/* files for dynamic rotation.

Interestingly, https://github.com/vyos/vyos-1x/commit/ae52b7799f6872ee9ea2475e76a6d4ea32c2ddce claims to change the log size to 1MB, but is the source of the current hard coded limit.

https://github.com/vyos/vyos-1x/commit/e143e496e28b9d6d5803278fa76a14bf2bc2304e seems to be the source of the current config formats.

Both the original config formatting and new config formatting suggest /var/log/messages should be a hard coded size. However, the CLI directly suggests the size of messages and the number of historical copies is configurable:

# set system logs logrotate
Possible completions:
 > atop                 Atop logs options (system resources usage)
 > messages             The /var/log/messages file rotation

# set system logs logrotate messages
Possible completions:
   max-size             Size of a single log file that triggers rotation (default: 1)
   rotate               Count of rotations before old logs will be deleted (default: 10)

I may have got lucky with my edit of rsyslog.conf but there is a discrepancy between the rsyslog config and logrotate as well as a fairly big mismatch in expectations between the CLI and actual logrotate configurations.

I think I've traced the issues. There are 3 different bugs:

1.) There are two different configuration scripts that generate /etc/logrotate.d/vyos-rsyslog
system_syslog.py renders /etc/logrotate.d/vyos-rsyslog with logrotate.j2; This is the old/original config
sytem_logs.py renders /etc/logrotate.d/vyos-rsyslog with vyos-rsyslog.js; This is the new config based on the new cli

logrotate.j2 has generation for "files" but I cannot find a cli for this. Are user log files still supported somewhere? If not, it probably makes sense to just jettison this template altogether.

2.) rsyslog rendering doesn't consider logrotate settings in rsyslog.conf.j2

3.) prifilt rendering in rsyslog.conf.j2 is incorrect based on my perception of the cli
The default prifilt is prifilt("*.info,local7.debug"). If the user configures daemon to err, the string will become prifilt("*.info,daemon.err,local7.debug"). daemon will still log at info. I think the string should probably be prifilt("*.info;daemon.none,local7.none,daemon.err,local7.debug")

If someone can help me with a decision on item 1 and assess if my perception is correct for item 3, I think I can probably create a fix.

c-po raised the priority of this task from Low to High.Feb 8 2026, 7:45 PM
c-po added a project: VyOS 1.5 Circinus.
Viacheslav moved this task from Need Triage to Completed on the VyOS Rolling board.
Viacheslav removed a project: VyOS 1.5 Circinus.
dmbaturin changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.
dmbaturin changed Issue type from Unspecified (please specify) to Bug (incorrect behavior).