Hi David,
My first thought was to use logrotate since it is there and does the
job well.
Problem is I don't know of a way to configure logrotate to
automatically rotate *.log found under /var/vhosts/ in any number of
sub-directories.

• I want Cake to react and start rotating custom logfiles like app/tmp/
logs/my_test.log if I choose to start logging to that file.
• I want each vhost running a Cake app to rotate its logs without the
manual overhead of going into logrotate's configuration.

With these prerequisites I thought it simpler and more portable to do
the rotation from Cake instead of having Cake manage its own logrotate
configuration files and run logrotate using exec or something.

I have a "v0.1" running of a LogrotationComponent. All I have missing
still is a fallback default rotation of all files not specified with
custom settings. I'll post it in the bakery or something when it feels
a bit more complete if anyone else wants to have a look. I am trying
to build it as Cake-friendly as I know how to make it possible to
paste it into the CakeLog class, which would be the natural place for
it.

Logrotate would probably be a bit faster though. If the configuration
could be managed "automatically" it would be a good alternative.

/Martin


On Jun 17, 12:52 pm, davidpersson <[EMAIL PROTECTED]> wrote:
> Wouldn't it be possible to let logrotate manage the cake logs?
>
> http://gentoo-wiki.com/HOWTO_Setup_Logrotate
>
> This way you don't have to code that in php. It's already there.
>
> [EMAIL PROTECTED] wrote:
> > Hi,
> > I was wondering if there was a log rotation feature built somewhere in
> > the Cake core (or an extension ofcourse)
>
> > The reason I am looking for this within cake and not leaping to the
> > standard log rotation in Linux is that many vhosts with many logs
> > would make that a bit of a pain to manage.
>
> > I have had a look around the CakeLog class and tried searching here,
> > the bakery and trac but I returned nothing.
>
> > If there is nothing like this already I would welcome a few
> > suggestions on what features might be useful. SInce I feel I need the
> > functionality I will probably code my own class/component (or
> > whatever) to enable log rotation.
>
> > thanks
> > Martin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to