Apache's access_log file rotates out into an archived copy around 1GB every few days. Where are the settings to control this? I'd like to be able to control both the max size and the number of archived logs it keeps around. Is this part of apache's configuration, or do I need to write cron jobs ( et al ) to deal with this? I'm running pre-forked httpd.
By default, you can find the Apache access log file at the following path: /var/log/apache/access. log. /var/log/apache2/access.
What are Apache Access Logs? As mentioned above, the Apache access log is one of several log files produced by an Apache HTTP server. This particular log file is responsible for recording data for all requests processed by the Apache server.
On most Linux distributions, the system is set up to run logrotate on a daily basis. You won't see it in the crontab for root or for any particular user.
It's easy to change how it handles log files. On my Ubuntu server, the /etc/logrotate.conf
file has settings like these:
# rotate log files weekly weekly # keep 4 weeks worth of backlogs rotate 4 # create new (empty) log files after rotating old ones create # uncomment this if you want your log files compressed #compress
[etc.]
And, you can look in the directory /etc/logrotate.d/
to see settings for specific directories and apps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With