View previous topic :: View next topic |
Author |
Message |
col l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/151396989846b908e08692e.jpg)
Joined: 08 May 2002 Posts: 820 Location: Melbourne - Australia
|
Posted: Tue Dec 17, 2002 11:13 pm Post subject: apache logs |
|
|
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. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
fuji Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/gallery/StarCraft/starcraft_protoss_darktempl.gif)
Joined: 26 Apr 2002 Posts: 111
|
Posted: Tue Dec 17, 2002 11:38 pm Post subject: |
|
|
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 :)](images/smiles/icon_smile.gif) _________________ Came for the hype, stayed for Portage. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
col l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/151396989846b908e08692e.jpg)
Joined: 08 May 2002 Posts: 820 Location: Melbourne - Australia
|
Posted: Tue Dec 17, 2002 11:54 pm Post subject: |
|
|
can syslog rotate them ? .... as I said my logs in /var/log are already rotating, just not the apache logs ? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
seaweed n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 22 Apr 2002 Posts: 53 Location: NJ, USA
|
Posted: Mon Mar 31, 2003 3:28 am Post subject: syslog cannot rotate logs. |
|
|
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. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
crown n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/17008710104202cedf034ab.gif)
Joined: 15 Jun 2002 Posts: 64
|
Posted: Mon Mar 31, 2003 3:48 am Post subject: |
|
|
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
Code: | ACCEPT_KEYWORDS="~x86" emerge cronolog |
Then check the docs at http://www.cronolog.org/usage.html for setting it up with apache. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
MasterC Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 25 May 2003 Posts: 150 Location: Woods Cross, UT
|
Posted: Sun Jun 29, 2003 11:51 pm Post subject: |
|
|
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.
Cool |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|