Can Nextcloud logs be cleared?

NethServer Version: NethServer release 7.3.1611 (Final)
Module: Nextcloud v12

Hello @dev_team,

In my Nextcloud under the Admin panel > Logging. I’ve set logging to include debug.

Is there a way to clear Nextcloud logs? I’m testing OnlyOffice connecting to my Nextcloud and need to send Logs to OnlyOffice team. Currently my Nextcloud log is very large. I want to clear the log, retest my Nextcloud/OnlyOffice and hopefully capture the necessary errors in the log to send.

Is there a way to clear the log in Nextcloud to reduce the amount of noise/history I currently displayed in logging?

Thank you.

Sorry for late reply. Probably you don’t need it anymore. Anyhow…

Other system logs are rotated using logrotate, but nextcloud.log has not been configured to use it. @greavette, is it worth?, could this be a new feature request for the @dev_team ?

Nextcloud has it’s own log rotation mechanism, handled by the log_rotate_size config parameter, which should serve your purpose.
I have tried it with the default Nethserver Nextcloud package, and the log was not rotated. :cry:

IMO it would be better to rotate the logs rather than clear or delete them. But here are two ways to clear it:

> /var/lib/nethserver/nextcloud/nextcloud.log

or

truncate /var/lib/nethserver/nextcloud/nextcloud.log --size 0

Sorry for the late response, I noticed a while ago that the log is not rotated.

What about adding a logrotate config for it?

1 Like

Added to junior job list: https://github.com/orgs/NethServer/projects/1#card-3644347

I think @Sebastian will give it a try next days!

1 Like

@greavette @dnutan would you like to try?

In nethserver-testing repo, thanks to @Sebastian:

1 Like