我已经编写了一个自定义附加程序,那么如何在 Log4j.xml 文件中声明它。
My property file is[custom appender is in org.copofi.common.logging.SystemStatusAppender] :
log4j.rootLogger=INFO,logfile,console,SystemStatus
log4j.logger=INFO,logfile,console,SystemStatus
# Console appender (stdout)
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=[%d{yy-MM-dd HH:mm:ss.SSS}] [%p] <%t> [%X{jsessionId}] [%c] %m%n
# File appender
log4j.appender.logfile=org.apache.log4j.FileAppender
log4j.appender.logfile.File=${catalina.base}/logs/copofi.log
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=[%d{yy-MM-dd HH:mm:ss.SSS}] [%p] <%t> [%X{jsessionId}] [%c] %m%n
log4j.appender.SystemStatus=org.copofi.common.logging.SystemStatusAppender