Audit Log File Rotation

Nextcloud version (eg, 12.0.2):18.0.2
Operating system and version (eg, Ubuntu 17.04):Ubuntu 18.04
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.29
PHP version (eg, 7.1):7.2.24

Is there a way to rotate the audit.log file (by default in the root of the Nextcloud data directory)? Looking at the admin_audit code (apps/admin_audit/lib/BackgroundJobs/Rotate.php) it seems to have some support for rotating, but unable to find any documentation on this.

FYI…I am currently sending the nextcloud logs to syslog (which handles rotation/retention) so file logging is disabled for the Nextcloud logs.


I thought of the same thing but ignored it then again because I had other stuff to do. You could use the system logrotate as described here: Log won't rotate

If I go the logrotate route, do you know if there is any command that needs to be run to have nextcloud update its file handers so that it doesn’t continue just writing to the rotated (ie renamed file) and opens a new ‘audit.log’ file?