WBCE / WBCE_CMS

Core package of WBCE CMS. This package includes the core and the default addons. Visit https://wbce.org (DE) or https://wbce-cms.org (EN) to learn more or to join the WBCE CMS community.
https://wbce-cms.org
GNU General Public License v2.0
31 stars 22 forks source link

Automatic zipping / deleting of logfiles generated by errorloger module #492

Closed instantflorian closed 3 years ago

instantflorian commented 3 years ago

The file /var/logs/php_error.log can become very, very huge if a site has heavy traffic. Since even notices, which do not break the function of the website, are logged, the site administrator would not even notice the issues until the website slows down or stops working completely due to logfiles with 20.000.000 entries. (This really happened.) So we urgently need a solution to zip/delete the logfile from time to time automatically, and/or an option to configure which errorlevel shoud be logged and/or a warning mechanism if the file gets too large. If all this is not possible, the module has to be removed from core, since many non-technical skilled WBCE users will never have a look at the logfile anyway.

webbird commented 3 years ago

Possible solution A:

Possible solution B: Log file rotation

dev4me commented 3 years ago

My personal idea: A website writing 20 million notices/warnings/errors should be fixed first instead of "shooting the messenger".

instantflorian commented 3 years ago

yes, that was a very special case and the entries were caused by an extra application which was wrapped into WBCE. But we also had some posts about the logfile flooding the server in the forum, and there is generally in my opinion no use of logfiles with hundered or thousand equal entries. But nevertheless, I'm sad that you read my post as "shooting the messager" idea. It was not meant as this, just as an idea/wish for improving this useful module.

dev4me commented 3 years ago

You should read "shooting the messenger" as, fixing the reporting module instead of fixing the cause of the problem. (it was not taken personal :)

I agree, such a big erorlog is not usable, but an auto-remove/auto-rename function should at least warn the system admin (by mail).

webbird commented 3 years ago

You're both right, please don't fight. Let's just find a good solution.

dev4me commented 3 years ago

Simple solution for anyone with large errorlogs. https://dev4me.com/modules-snippets/opensource/logrotate/

instantflorian commented 3 years ago

Thank you very much for the extra fast solution!