0

i am using log4php for my logging in my development.

is it possible to use 2 appenders on a single logfile?

i wanted to have a daily logfile, thus wanted to use LoggerAppenderDailyfile
that have properties also of rolling, thus needs the LoggerAppenderRollingFile.

or if there is a way to configure the LoggerAppenderRollingFile to generate new
log files everyday and can set the date(and format) as the filename , that would really be
helpful.

do you guys have any idea?

thanks a lot,
tinks

2
Contributors
3
Replies
5
Views
6 Years
Discussion Span
Last Post by pritaeas
0

This is my properties file:

log4php.rootLogger=ALL, B
log4php.appender.B=LoggerAppenderDailyFile
log4php.appender.B.file=/log4php_files/B_%s.log
log4php.appender.B.layout=LoggerPatternLayout
log4php.appender.B.layout.ConversionPattern=%d %-5p %m%n

You can find examples in the manual.

Edited by pritaeas: n/a

0

hi!

thanks for the reply.

yeah i've tried the dailyAppenderFile and it actually is fine, except that
im not sure if it creates the backup file everytime the capacity of the
current logfile is reached? just like the behavior of the RollingFile?

say:

2011-01-10.log
2011-01-10.log.1
2011-01-10.log.2

because i need something like this..

i kind of need a combination of the two behaviors..

0

Can't find anything for php. Log4j has DailyRollingFileAppenderExt which has this functionality. Perhaps you should write your own.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.