最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

rollingfileappender - Log4j appending to closed appender - Stack Overflow

programmeradmin1浏览0评论

I have a quartz application where I'm using an appender (DailyRollingFileAppender) for each job. I also have a console appender so each appender can output to the console as well. I think what is happening is that once each job is complete, it looks like it's closing its appender and then also closing the console appender. We're seeing errors where log4j is complaining about appending to a closed appender (the console one).

Is there a configuration I could create where a single console appender can be used for multiple class-based appenders that are opening and closing?

This is what each class appender has for configuration:

log4j.appender.internal=org.apache.log4j.DailyRollingFileAppender
log4j.appender.internal.DatePattern='.'yyyy-MM-dd
log4j.appender.internal.File=log/internal/internal.log
log4j.appender.internal.layout=org.apache.log4j.PatternLayout
log4j.appender.internal.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %C{1}:%L - %m%n
log4j.category.internal=INFO, QUEUE_CON, internal
log4j.additivity.internal=false

Thanks.

发布评论

评论列表(0)

  1. 暂无评论