I currently have a Django app running on Ubuntu under Apache. The Apache logs are generated at:
/home/user/django/myproject/log/apache_access.log
/home/user/django/myproject/log/apache_error.log
The above logs are currently growing very rapidly, so I create a configuration file for logrotate and place it under /etc/logrotate.d
. The configuration is called: my_app
, it's path is /etc/logrotate.d/my_app
. The content of my_app
is:
/home/user/django/myproject/log/*.log{
daily
missingok
rotate 7
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
/etc/init.d/apache2 reload > /dev/null
fi
endscript
}
Will the above configuration logrotate the apache log?