log4j category

自古美人都是妖i 提交于 2019-12-03 16:28:46

Just to finish this thread, the real issue was that the first value on your category line should of been a log level. So, as you correctly discovered, changing :

log4j.category.ConsultaDados=ConsultaDados

to

log4j.category.ConsultaDados=info,ConsultaDados

worked properly. As an FYI, you could of also changed the line to

log4j.category.ConsultaDados=,ConsultaDados

which would of caused you to inherit the logging level from the root logger.

First, your category is not mapped to an appender, second ConsultaDadosEORI doesn't match any category.

Here is a sample :

log4j.appender.YOUR_APPENDER=org.apache.log4j.RollingFileAppender
log4j.appender.YOUR_APPENDER.File=${SYSTEM_PROPEY_WITH_LOGGER_FOLDER}/log_file.log
log4j.appender.YOUR_APPENDER.Append=true
log4j.appender.YOUR_APPENDER.MaxFileSize=20MB
log4j.appender.YOUR_APPENDER.MaxBackupIndex=2
log4j.appender.YOUR_APPENDER.layout=org.apache.log4j.PatternLayout
log4j.appender.YOUR_APPENDER.layout.ConversionPattern=%d [%t] %p %c - %m %n
log4j.category.**YOUR_PACKAGE**=**INFO,YOUR_APPENDER** 
log4j.additivity.**YOUR_PACKAGE**=true or false
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!