Server Logs being changed How do I stop it

I have discovered that my Apache logs are being changed by the system and it seems converted into simple data for statistics. I want to keep the logs intact and not to lose information in them IP addresses etc. How do I do this? I am not averse to changing things on the server outside Virtualmin itself.

I don’t know what you’re talking about, so I can’t offer any advice.

The log format in Virtualmin, by default, is the standard Apache common log based format. That format includes client IP addresses.

I have server logs created by Apache. Something is deleting the old logs from more than a few days ago. I don’t want it to do that. I want to keep them. How do I do that?

In Virtualmin (and many other servers and control panels) the logs are automatically archived after a certain number of days. The data is still there, but compressed in individual archive files so that disk storage is utilised optimally and the size of the log file does not become unweildly.

If you disable this best practice and insist of keeping all your logs in a single log file, it may work for a few days or weeks but then you will have trouble at some point in the future.

You will have to find a way to accomplish whatever it is that you wish to accomplish by using the current log file and the compressed archives of older log files.

1 Like

So where has my data gone then? With this particular log set it will last for some time. If you could tell me where it has been compressed to I’d be very grateful because I can’t find it.

Web server logs for Virtualmin domains are in /var/log/virtualmin. The rotated logs are gzipped and renamed to include the date of rotation in the name. Several weeks worth of rotations are retained, and this is configurable in the same way you’d configure it on any other modern Linux system…we use logrotate, like everything else on your system.

The Virtualmin web server log logrotate config is in /etc/logrotate.d/virtualmin.conf

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.