dcsimg
How to have multiple log file names under rotatingfileappender
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   barkha_shah
Posted On:   Wednesday, June 16, 2004 12:31 AM

Hi, Besides having a below mentioned fileName, I want to have logging in another file also for different purpose. For ex: I want to do some tracing activity of my own application in a different log file c:/cota/logs/def.log Please help . I am new to log4j module and carry less knowledge about it. Can any one help me as to how do i change the code ( in C++) and how to change the configuration settings to allow multiple log file names. Thanks barkha log4j.properties ================= # Set root logger level to DEBUG and its only appender to A1. log4j.rootCategory=WARN,DAILYFILE log4j.category.cota=INFO # DAILYFILE is a RotatingFileAppender that rotates daily    More>>

Hi,
Besides having a below mentioned fileName, I want to have logging in another file also for different purpose.
For ex: I want to do some tracing activity of my own application in a different log file
c:/cota/logs/def.log
Please help . I am new to log4j module and carry less knowledge about it. Can any one help me as to how do i change the code ( in C++) and how to change the configuration settings to allow multiple log file names.
Thanks
barkha

log4j.properties
=================
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootCategory=WARN,DAILYFILE
log4j.category.cota=INFO

# DAILYFILE is a RotatingFileAppender that rotates daily
log4j.appender.DAILYFILE=org.apache.log4j.RollingFileAppender
log4j.appender.DAILYFILE.fileName=c:/cota/logs/abc.log
# Doesn't work: log4j.appender.DAILYFILE.DatePattern='.'yyyy-MM-dd
log4j.appender.DAILYFILE.maxFileSize=2000000
log4j.appender.DAILYFILE.maxBackupIndex=10
log4j.appender.DAILYFILE.layout=org.apache.log4j.PatternLayout
#log4j.appender.DAILYFILE.layout.ConversionPattern=%d{ISO8601} [%X{webapp}:%t] %-5p %c%x - %m%n
# X (MDC (mapped diagnostic context)), t (thread) not supported.
#log4j.appender.DAILYFILE.layout.ConversionPattern=%d{ISO8601} [%x{webapp}] %-5p %c%x - %m%n
log4j.appender.DAILYFILE.layout.ConversionPattern=%d{ISO8601} %t %-5p %c%x - %m

   <<Less
About | Sitemap | Contact