Link to home
Start Free TrialLog in
Avatar of Milenkan
Milenkan

asked on

No appendors found for category

I am receiving the following error(s) when running a command for updates and I am not sure of the problem.


log4j:ERROR No appenders could be found for category (com.example.application.db.DatabaseAccess).
log4j:ERROR Please initialize the log4j system properly.

Below is my log4j properties file.


# Set root category priority to DEBUG with both the Console and
RollingFile
# appenders defined below
log4j.rootCategory=DEBUG, RollingFile

# RollingFile is set to be a RollingFileAppender
log4j.appender.RollingFile=org.apache.log4j.RollingFileAppender
log4j.appender.RollingFile.File=${ICX_HOME}/log/agent.log
log4j.appender.RollingFile.MaxFileSize=1MB
log4j.appender.RollingFile.MaxBackupIndex=10

# RollingFile uses PatternLayout
log4j.appender.RollingFile.layout=org.apache.log4j.PatternLayout
# Print the date in ISO 8601 format
log4j.appender.RollingFile.layout.ConversionPattern=%d (%x)[%t] %-5p
%c{1} - %m%n

# Print only messages of priority XXX or above in the package
com.example.application
log4j.category.com.example.application=INFO
log4j.category.com.example.application.agent=INFO
log4j.category.com.example.application.agent.task.TaskBase=DEBUG
log4j.category.com.example.application.agent.protocol.snmp.ContextMan
ager=WARN

# ThreadDumpRollingFile is set to be a RollingFileAppender
log4j.appender.ThreadDumpRollingFile=org.apache.log4j.RollingFileAppende
r
log4j.appender.ThreadDumpRollingFile.File=${ICX_HOME}/log/threaddump.log
log4j.appender.ThreadDumpRollingFile.MaxFileSize=10MB
log4j.appender.ThreadDumpRollingFile.MaxBackupIndex=10

# ThreadDumpRollingFile uses PatternLayout
log4j.appender.ThreadDumpRollingFile.layout=org.apache.log4j.PatternLayo
ut
# Print the date in ISO 8601 format
log4j.appender.ThreadDumpRollingFile.layout.ConversionPattern=%d
(%x)[%t] %-5p %c{1} - %m%n

log4j.category.com.example.common.thread=DEBUG, ThreadDumpRollingFile

Any insight as to what could be causing this would be much appreciated.
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You really have not defined this category. Since category is already deprecated I recommend you to change Category with logger, so replace line
log4j.rootCategory=DEBUG, RollingFile
with
log4j.rootLogger=DEBUG, RollingFile
Then replace this lines:
log4j.category.com.example.application=INFO
log4j.category.com.example.application.agent=INFO
log4j.category.com.example.application.agent.task.TaskBase=DEBUG
log4j.category.com.example.application.agent.protocol.snmp.ContextMan
ager=WARN
with this lines:
log4j.logger.com.example.application=INFO
log4j.logger.com.example.application.agent=INFO
log4j.logger.com.example.application.agent.task.TaskBase=DEBUG
log4j.logger.com.example.application.agent.protocol.snmp.ContextMan
ager=WARN
In this case you will have rootLoger and the loggers not presented will have defaul level taken from the rootLogger. Hope it will help you!
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.