-
Notifications
You must be signed in to change notification settings - Fork 33
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
Log rotation for all components #825
Comments
Hi Morgan, we know there is a lot of space for improvements and we have in roadmap to improve the overall logging approach of the playbook to make it more production-grade and ease the integration with 3rd party logging systems. (OPSEXP-2085) I think that:
are two good tasks which go in the right direction. I am not sure if configuring log rotation at tomcat level via log4j has more advantages, but more in general I would prefer having a single system-wide approach via system logrotate. A nice to have for nginx is to mv the eventual existing logs to the new folder and place symlinks in place of them, so if someone is used to it can still find them. Thank you once more for taking the time to investigate and provide detailed suggestions for potential enhancements. |
I would also believe logrotate is easier to setup and manage for multiple logs. However, there is a point that might be annoying is that the Alfresco and Share logs are rotated by Tomcat with a suffix. E.g. from Hence my point about modifying the war files log4j.poperties (or having a crontab that makes sure nothing older than 10/15/30 days is left in the folder, whatever its name might be). |
Yes, log rotation should be managed in a single place only, so it needs to be disabled in the tomcat log4j configuration. It should be possibile to have logrotate match all the eventually existing already-rotated tomcat logs, to compress and ultimately deleting them when they reach expiration. |
Bug (improvement) description
As far as I could see, there doesn't seem to be log rotation for some of the components installed by the Ansible playbooks and the number of logs kept is pretty different for each as well.
Playbook version
Status as of 20-Feb-2024 - installing a Community 7.3.0
Details
Solr -- Appears to be "OK", it comes by default with 9 log files (of 4Mb each max)
Share -- Does not appear to contain any rotation/max logs
Alfresco -- Does not appear to contain any rotation/max logs
Nginx -- Does not appear to contain any rotation/max logs
Tomcat -- Appears to be "OK", it comes by default with 90 log files
ActiveMQ -- Appears to be "OK", it comes by default with 5 log files of 1Mb each
Transform Service (AIO) -- Does not appear to contain any rotation/max logs BUT the start/stop script
/opt/alfresco/ats-ate-aio.sh
will overwrite the log file at each startup, so considering ATS isn't logging too much information, that might be "OK" to leave it like that?I do not have access to enterprise components so I couldn't check the status there.
Proposal
I believe the configuration should be added to at least have log rotation for all components and optionally (if possible) align the number of logs to keep.
The biggest problem from my point of view being Nginx (+Alfresco/Share), since it is never rotated, the access log will grow very fast and fill the filesystem (even if the environment isn't used, because of Solr tracking).
Considering that Nginx installation depends on the OS, should the nginx log files be put back into the standard log folder (
/var/log/nginx/
), so that the logrotate configured by the OS package of Nginx is taken and applied OOTB (with itsrotate 14
config)? This would need to be changed in HTTP + HTTPS templates (e.g. here and here)/!\ to be checked if SELinux is still OK on the default folder but normally the OS package takes care of that.
Alternatively, it can be added into a custom logrotate on
nginx
hosts, but in this case, it might be difficult to handle the owner/permissions and pre/post tasks as the OS package logrotate does. I believe using the OOTB folder would simplify the log rotation (but then it's outside of the volume /var/log/alfresco/ that is asked for all logs... so pros vs cons)I assume this could be easily done by modifying the log4j.properties inside the WAR files (or v2 for higher versions of Alfresco) or adding a custom logrotate or a cronjob to delete log files older than XX or ...
What do you think on all that?
The text was updated successfully, but these errors were encountered: