I can’t make the log rotate properly. Not sure why.
I moved the log to /var/log/nextcloud.log (in the config.php). then had to create that file and give it the (hopefully) right permissions or else it couldn’t be created:
-rw-r----- 1 www-data www-data 16M Jun 25 17:15 nextcloud.log
Then it wanted to create nextcloud.log.1 but couldn’t so I had to create that one too:
-rw-r----- 1 www-data www-data 0 Jun 25 16:31 nextcloud.log.1
Now when the 10 mb are full it gives me the error below and nextcloud.log.1 stays empty.
nextcloud.log:
{"reqId":"B+khwHHGDKU0vvt6P8l2","remoteAddr":"","app":"PHP","message":"rename(\/var\/log\/nextcloud.log,\/var\/log\/nextcloud.log.1): Permission denied at \/var\/www\/nextcloud\/lib\/private\/log\/rotate.php#46","level":3,"time":"2016-06-25T17:15:01+02:00","method":"--","url":"--","user":"--"}
{"reqId":"B+khwHHGDKU0vvt6P8l2","remoteAddr":"","app":"OC\\Log\\Rotate","message":"Log file \"\/var\/log\/nextcloud.log\" was over 10485760 bytes, moved to \"\/var\/log\/nextcloud.log.1\"","level":2,"time":"2016-06-25T17:15:01+02:00","method":"--","url":"--","user":"--"}
config.php:
'loglevel' => 2,
'logfile' => '/var/log/nextcloud.log',
'log_rotate_size' => 10485760,`
What did I do wrong?