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.
Asked
Active
Viewed 606 times
1 Answers
0
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.

kronn
- 925
- 11
- 31
-
Thanks for your answer. Your assumptions are corrett. Each file retains different access, but logrotate does not happens daily. For example, in my current access.log file there are requests recorded on 27 August till Today.How can I have each request recorded in one single file? – Lorenzo Sep 07 '17 at 09:25
-
this is a different question. If you are in a hosted environment, try to contact you hoster. if you're on your own, look into logrotate to configure it towards your needs. Generally, logrotate is a good idea to keep your logfiles to a manageable size. If your research on logrotate is unconclusive, ask a new question here (or at https://serverfault.com, which is more admin-related). – kronn Sep 13 '17 at 09:13