Adding a file to logrotate

Virtualmin sets up logrotation for each domain, which is fine.
However, besides access_log and error_log i also have a php_log file, which logs all php notices/warnings/errors.
Is it possible to tell Virtualmin to add this file to logrotate? Possibly, to all existing virtual servers as well?
Cheers :slight_smile:

Howdy,

You can configure what’s used for the log file rotation for each Virtual Server, by going into System Settings -> Server Templates -> Log File Rotation.

As far as re-configuring existing Virtual Servers, you could use the command line tool to disable the “logrotate” feature, then re-enable it. You can run “virtualmin disablefeature” for some more info on doing that.

-Eric

Disablind and re-enabling is a great idea :wink: And I LOVE Virtualmin’s command line API.
Anyway, there is a problem with the System Settings -> Server Templates -> Log File Rotation thing, cause everything i put in there gets added inside the what it seems hard-coded brackets.
so basically in the config i put this:

${HOME}/logs/access_log ${HOME}/logs/error_log ${HOME}/logs/php_log {
        rotate 5
        weekly
        compress
        postrotate
        /usr/sbin/apache2ctl graceful
        endscript
}

but now i get this in /etc/logrotate.conf:

/home/somedomain.tld/logs/access_log /home/somedomain.tld/logs/error_log {
	/home/somedomain.tld/logs/access_log /home/somedomain.tld/logs/error_log /home/somedomain.tld/logs/php_log {
		rotate 5
		weekly
		compress
		postrotate
		/usr/sbin/apache2ctl graceful
		endscript
	}
}

also, disabling the logrotate feature did not correctly remove all entries rom the logrotate.conf file, which is not that tragic, since i just removed them manually… but i guess it’s a bug.

anyway, it seems I’m stuck with access_log and error_log files only, unless there is another way. anyone? :slight_smile:

bump :stuck_out_tongue:

Don’t say “bump”, it drive me insane :slight_smile: (pick some other phrase :slight_smile:

However, you have a point – this all should be possible, as a person could certainly want to add something to log rotation for one or more Virtual Servers.

And in all my poking around, I just don’t see a way to do that currently…

So my recommendation would be to file a bug report, and to tell Jamie what you told me – that you have an additional file you want added to the log rotation for all your Virtual Servers, and to see what he recommends.

-Eric