dcsimg
Add an Appender defined in the configuration file to a Logger in runtime
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Blaise_Gosselin
Posted On:   Thursday, August 11, 2005 09:14 AM

Hello, I'm using Log4j in my Web application with a log4j.properties file like this : ----------------- log4j.logger.package.className=DEBUG, A1, dailyHtmlLog # dailyHtmlLog log4j.appender.dailyHtmlLog = org.apache.log4j.DailyRollingFileAppender log4j.appender.dailyHtmlLog.File = C:/daily.log log4j.appender.dailyHtmlLog.DatePattern = '.'yyyy-MM-dd log4j.appender.dailyHtmlLog.layout = org.apache.log4j.PatternLayout log4j.appender.dailyHtmlLog.layout.ConversionPattern=%d %-5p %c %x - %m%n # wslog log4j.appender.wslog = org.apache.log4j.DailyRollingFileAppender log4j.appender.wslog.File = C:/ws.log    More>>

Hello,

I'm using Log4j in my Web application with a log4j.properties file like this :



-----------------

log4j.logger.package.className=DEBUG, A1, dailyHtmlLog

# dailyHtmlLog

log4j.appender.dailyHtmlLog = org.apache.log4j.DailyRollingFileAppender

log4j.appender.dailyHtmlLog.File = C:/daily.log

log4j.appender.dailyHtmlLog.DatePattern = '.'yyyy-MM-dd

log4j.appender.dailyHtmlLog.layout = org.apache.log4j.PatternLayout

log4j.appender.dailyHtmlLog.layout.ConversionPattern=%d %-5p %c %x - %m%n

# wslog

log4j.appender.wslog = org.apache.log4j.DailyRollingFileAppender

log4j.appender.wslog.File = C:/ws.log

log4j.appender.wslog.DatePattern = '.'yyyy-MM-dd

log4j.appender.wslog.layout = org.apache.log4j.PatternLayout

log4j.appender.wslog.layout.ConversionPattern=%d %-5p %c %x - %m%n

---------------



I'd like to know if it is possible to add the Appender called wslog to my class package.className in runtime ?


So, i'd like to know if it is possible with Log4j to get all the Appenders defind in the configuration file...



Thanks in advance !!

Blaise Gosselin

   <<Less
About | Sitemap | Contact