# apache logs

## col

My apache logs are not rotating. The default directory for the logs is /var/log/apache but none of them rotate. What is the best way to rotate them monthly? I have syslogd installed...can this be used ? Most of my logs in /var/log rotate already.

----------

## fuji

emerge logrotate

This little program does a pretty good job of it....

Just set it up to run in a daily cron job as root... and it'll take care of all.  I use it for my mysql logs as well... since they can get pretty large....

man logrotate # for more information...

hope this helps  :Smile: 

----------

## col

can syslog rotate them ? .... as I said my logs in /var/log are already rotating, just not the apache logs ?

----------

## seaweed

 *Quote:*   

> can syslog rotate them ? .... as I said my logs in /var/log are already rotating, just not the apache logs ?

 

No, syslog is for writing logs.

Since you said that your other logs are rotating I assume you have logrotate.  

You just need to add the apache logs to the logrotate config file.

----------

## crown

He is probably using metalog which is the syslogger suggested by the gentoo install docs. It will rotate logs by default however apache does not use the syslogger. It uses it's own logging mechanism however you can use other tools such as logrotate to rotate them. 

Personally I use "cronolog". It's masked by default but you can emerge it by doing

```
ACCEPT_KEYWORDS="~x86" emerge cronolog
```

Then check the docs at http://www.cronolog.org/usage.html for setting it up with apache.

----------

## MasterC

I'd just like to say thank you!  I've had great luck from simply searching the forums here!  I was searching for info on why my logs are rotating without having logrotate installed.  Metalog is a very nice logger I must say.

 :Smile: 

Cool

----------

