Log rotates to nextcloud.log.1 but nextcloud.log.2, etc are gone

Nextcloud 20.0.5
PHP 7.3.26-1
Apache 2.4.46
Ubuntu 18.04 Server VM on Virtualbox Ubuntu 18.04 host machine

‘logfile’ => ‘/var/nc_data/nextcloud.log’,
‘loglevel’ => 2,
‘logtimezone’ => ‘Europe/Berlin’,
‘log_rotate_size’ => 104857600,

/var/nc_data has a nextcloud.log and a nextcloud.log.1 file. nextcloud.log seems to be rotating to nextcloud.log.1, however no nextcloud.log.2 is created. It seems the oldest data in nextcloud.log.1 is wiped away instead. or is it possibly rewritten to another location? Hopefully?

Help please!?

1 Like

Despite the name, there is no “real logrotation” from within Nextcloud. From the documentation:

'log_rotate_size' => 100 * 1024 * 1024,

Enables log rotation and limits the total size of logfiles. Set it to 0 for no rotation. Specify a size in bytes, for example 104857600 (100 megabytes = 100 * 1024 * 1024 bytes). A new logfile is created with a new name when the old logfile reaches your limit. If a rotated log file is already present, it will be overwritten.

1 Like