Easy way to do this:
- Delete all entery in /path/to/nextcloud/data/nextcloud.log
- add ‘logfile’ => ‘/path/to/nextcloud/data/nextcloud.log’, to /path/to/nextcloud/config/config.php
- done
Easy way to do this:
Or even easier, with just one command:
cat /dev/null > /path/to/nextcloud.log
or you could use the truncate command:
truncate -s 0 /path/to/nextcloud.log
Or the most elegant way would be to set up lograte, and then rotate the log file after you addressed the issues. That way you don’t loose your old log entries. See here: How to make Admin audit log (audit.log) compliant with GDPR - #3 by ernolf
After you have set that up, you can rotate the logs manually with a single command:
logrotate -vf /etc/logrotate.d/nextcloud