Logs

AtomicRax

Verified User
Joined
Oct 12, 2003
Messages
79
Hello,

Is there a way I can reset the logs or like delete old logs that DirectAdmin makes on my server? Like, error logs, mail usage logs, usage logs...

Is there an easy way to do this, or do I have to go to each log one by one cleaning it out?

This way, they don't get too big and waste a lot of space.
 
man logrotate
/etc/logrotate.conf

all the info you need in that command, and that file.

Chris
 
So DA is already setup to rotate logs and only keep a certain amount of backlogs?
 
Hello,

Many of the programs should already have logrotate scripts setup in the /etc/logrotate.d/ directory, but not all. DA will rotate the domain apache logs and will clear out the ftp bytes logs, but that's it. All other programs will need to have something in the /etc/logrotate.d directory if the logs are to be rotated.

John
 
The majority of the logs in /var/log/ are controlled by logrotate, as John pointed out... some are listed in the main config aswell as the include directory listed in the config..

Take note though, that with logs that are likely to be large (httpd access log for example) you CAN chnage the configuration for that only to be rotated at X kb or mb, aswell as a timeframe....

man logrotate will give you all the information you need on different options that may be used with the individual configs..

On a further note, my main logrotate.conf settings are:

rotate logs daily
keep 2 weeks of backlogs
create new logs as old logs are rotated

Them settings are generally fine, although I change settings around usually depending on the system itself and its usage.

Chris
 
Is this valid under the FreeBSD DA too? Cuz i dont see any log rotation happening. Some of my logs, i just noticed, have reached a 1GB!!
 
You must configure logrotate on any Operating System to rotate all logs other than apache.
 
DirectAdmin should be handling the rotation of apache logs. You can set the rotate size in the Administrative Settings page under the admin level.
Although I believe the default is 100mb so if you have logs that big you might want to check the system logs (/var/log/) right after the tally runs (when the logs should have been rotated) and see if they give you any hints as to why they are not rotating, as well as check the rotate settings I mentioned above.
 
Nice question; I noticed something some time ago, my /var/log/httpd/domains is expanding exponentially.
As in, nothing is rotating these logs by the looks of it.

Please tell me that isn't normal behaviour ?
If it isn't; does anyone have a way to correct it without breaking:
* awstats
* webalizer
* apache
* DA
 
Back
Top