Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

No appendors found for category

Posted on 2010-09-15
4
Medium Priority
?
392 Views
Last Modified: 2012-05-10
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.
0
Comment
Question by:Milenkan
4 Comments
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 33687349
sounds like its not finding your log4j.properties file
make sure it is in a directory that is in your classpath
0
 
LVL 16

Expert Comment

by:Valeri
ID: 33690815
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!
0
 
LVL 27

Expert Comment

by:mrcoffee365
ID: 37419055
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This video teaches viewers about errors in exception handling.
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question