Apache2 creates multiple Access Log Files

720 views Asked by At

I can't understand why my Apache Server generates multiple access log files. For example, it creates access.log, access.log.1, access.log.2 and so on. Every access.log file records differents requests. How can I record every request in a single File access.log? Thank you.

1

There are 1 answers

2
kronn On BEST ANSWER

It seems to me that you are looking at files that are left intentionally by logrotate.

If my assumptions are correct, apache only logs to access.log.

These logfiles get rotated out by logrotate to avoid overly large files. Usually, this happens daily. logrotate only keeps a certain amount of files, thereby preventing a full disk under normal circumstances.

To verify, you can check the timestamps in the logged requests. If they differ by a day, then logrotate is daily cleaning your logfiles without deleting them instantly.