How to keep a fixed file name for the latest log when error_log and access_log are rotated by rotatelogs in Apache httpd
Issue
- How can I keep a fixed file name for the latest log when
error_logandaccess_logare rotated byrotatelogs? - When I use
rotatelogsto rotate access_log with the following configuration, all files become the file name with the specified formataccess_log.%Y-%m-%d(likeaccess_log.2018-10-19,access_log.2018-10-20). I would like to keep the latest log file with just the file nameaccess_logfor monitoring purpose. How can I achieve this?
CustomLog "|sbin/rotatelogs -l logs/access_log.%Y-%m-%d 86400" combined
Environment
- Red Hat Enterprise Linux 7
- Red Hat JBoss Core Services
- Apache httpd 2.4
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
