Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make logrotation active by default #5165

Closed
zeus86 opened this issue May 30, 2017 · 6 comments
Closed

make logrotation active by default #5165

zeus86 opened this issue May 30, 2017 · 6 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: logging

Comments

@zeus86
Copy link

zeus86 commented May 30, 2017

This may sound like a low hanging fruit, but can be a hassle when forgotten.

the NC-internal Logrotation shall be enabled by default.

You can easily check this for your instance with
/var/www/nc# sudo -u www-data php occ log:owncloud
while in your installation folder. The ourput is then something like

Log backend ownCloud: enabled
Log file: /var/www/nc/data/nextcloud.log
Rotate at: 10 MB

...or - most likely when not changed - the rotation is disabled. You can e.g. enable this feature with
/var/www/nc# sudo -u www-data php occ log:file --rotate-size 10MB
in your instance root folder.
This is an often missed point during the setup on an installation, and you really want to have senseful defaults. Leaving the Logrotation disabled will cause problems most like after a few month. Enabling this by default should be not a problem at all. In addition to this you might want to have a more precise control that you might want to keep more than one rotated logfile if enabled.

@zeus86 zeus86 changed the title make logrotation active by defalut make logrotation active by default May 30, 2017
@patschi
Copy link
Member

patschi commented May 31, 2017

I would find this change useful as well.

To see current logging settings in NC12:

# sudo -u www-data php occ log:file
Log backend file: enabled
Log file: /var/cloud/data/nextcloud.log
Rotate at: disabled

To enable logrotation at 50 MB on NC12:

# sudo -u www-data php occ log:file --rotate-size=50M
Log backend file: enabled
Log file: /var/cloud/data/nextcloud.log
Rotate at: 50 MB

For advanced handling of Nextcloud logfiles the logrotate-daemon may be used, this is mostly pre-installed on many Linux distributions anyway.

@patschi patschi added enhancement feature: logging 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed enhancement labels May 31, 2017
@zeus86
Copy link
Author

zeus86 commented May 31, 2017

For advanced handling of Nextcloud logfiles the logrotate-daemon may be used, this is mostly pre-installed on many Linux distributions anyway.

yeah, thats true, but it has to be configured manually anyways, because it is inside the webroot folder and not within /var/log or something like that. I agree, that old-fashioned logrotate would be the better choice in general, but if NC has its own routines for that, why not use them? but at least it should be enabled by default

@patschi
Copy link
Member

patschi commented May 31, 2017

Usually logrotate does have an own configuration folder /etc/logrotate.d/, where you can create config files and point to any log files which should be rotated. So you could (1) point to your log file, /var/www/nc/data/nextcloud.log in your case, to rotate that file more precise as you want, or (2) even move the nextcloud log file to somewhere else using logfile-setting in the config file.

Anyway, yes, in my opinion there should be any default value aswell to prevent any massive increase in space consumption when high logging activity on bigger setups occurs.

@zeus86
Copy link
Author

zeus86 commented May 31, 2017

yes, i know of course, but that is not the point i'm trying to make. As you also noted there should be an active logrotation by default, because
a) for a webapp nextcloud writes rather huge logs and
b) to just not run into this problem

@rullzer
Copy link
Member

rullzer commented Apr 11, 2018

done in #9137

@rullzer rullzer closed this as completed Apr 11, 2018
@zeus86
Copy link
Author

zeus86 commented Apr 11, 2018

@rullzer cool, thank you. say, will this change lead to the activation of logrotate on installations in default-state when updating? or do old installations require manual intervention to make the rotation active?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: logging
Projects
None yet
Development

No branches or pull requests

3 participants