Disable Access Logs
I want to fully disable the access logs for all of my sites. When I set up the virtual hosts, I specified where to write the access logs.
If I just delete that line, will that stop the server from trying to write the log at all? Or will it still try to, but just end up writing nothing?
(I'll still keep storing error logs, but the access ones seem like a waste of CPU and they've built up to massive file sizes which is a nuisance)
Thanks for taking the time to read!
5 Replies
@Michael-Martin:
I want to fully disable the access logs for all of my sites. When I set up the virtual hosts, I specified where to write the access logs.
Presumably you're talking about a web server – but which one ? For nginx at least, you can use the directive
access_log off;
Don't forget that you can also rotate, compress and delete the logs using something like logrotate(8).
But why would you want to do that? Want bad guys to be able to mess with your sites without leaving any trace?
@hybinet - The reason is just that I've never done anything with the access logs. They're about 6GB in size at the minute, and because of that, if something did happen to the site, I'm not sure I'd ever even be able to find suspicious activity in all those thousands of entries
Or should I be watching the logs a little more closely?
-rw-r--r-- 1 www-data www-data 15202284 2010-03-21 05:09 access.log.3.gz
-rw-r--r-- 1 www-data www-data 14730444 2010-03-28 04:44 access.log.2.gz
-rw-r--r-- 1 www-data www-data 14034340 2010-04-04 04:55 access.log.1.gz
-rw-r--r-- 1 www-data www-data 107838104 2010-04-07 07:47 access.log
Uncompressed, this site produces about 250MB of logs per week, which compress to under 15MB. Easier than turning off logging.