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

Recommended Answers

All 3 Replies

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.

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..

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.