Hi Christian,

You mean functionally or in the class hierarchy?

Functionally this fixes an issue for long running PHP requests, but not everyone will like the rollover -- on a web app you might prefer log entries from a single request ending up in the same file even if it begins processing at 23:59:55 and finish at 0:00:05. But for something that runs continually for days (eg. a daemon), this appender makes more sense.

Regarding the class hierarchy this class is kind of a cross between LoggerAppenderDailyFile and LoggerAppenderRollingFile, and I've implemented it as a 'fork' of the former. Functionally it can be considered an extension though.

I originally wrote this patch about a year ago, and just ported it to 2.2.0 now, so I can't remember the exact reasoning. At the time it seemed easier to do it this way than making LoggerAppenderDailyRollingFile extend the LoggerAppenderDailyFile class. But I was not necessarily right about that.

Cheers,
Vik


On 01/13/2012 02:10 PM, Christian Grobmeier wrote:
Hello Viktor,

how does it compare to this appender?
http://logging.apache.org/log4php/docs/appenders/daily-file.html
Is it an extension?

Thanks for your work!
Cheers

On Fri, Jan 13, 2012 at 2:06 PM, Viktor Radnai<[email protected]>  wrote:
Hi all,

This is my first post to this list. I have created a
LoggerAppenderDailyRollingFile appender for a project that I'm working
on. This is needed there because I have a long-lived PHP process that
would otherwise not rotate the logfile. It is also possible to rotate
log files once every hour or even minute if needed, by setting the
'rotate' property appropriately. This is illustrated in the
configuration example below:

log4php.appender.logfile = LoggerAppenderDailyRollingFile
log4php.appender.logfile.layout = LoggerLayoutTTCC
log4php.appender.logfile.rotate = i
log4php.appender.logfile.datePattern = Ymd-Hi

The attached patch file is against 2.2.0/src/main/php. Would you
consider this appender useful for the general public and include in
the project?

Cheers,
Vik



Reply via email to