Monk LikeaSir
Monk LikeaSir

Reputation: 33

How to handle log4j no appenders error

Whenever I debug my code in Netbeans this appears:

log4j:WARN No appenders could be found for logger (org.apache.pdfbox.pdfparser.PDFObjectStreamParser).
log4j:WARN Please initialize the log4j system properly.

Why is this? Is this important?

Upvotes: 0

Views: 3708

Answers (2)

محسن عباسی
محسن عباسی

Reputation: 2424

For setting Log4j in runtime, do this:

java -Dlog4j.configuration=file:///D:/crawler4j-3.5/log4j.properties -jar newCrawlerV0.1.jar

Upvotes: 0

kosa
kosa

Reputation: 66637

Why is this?

The reason why you see this message is that your log4j configuration file(i.e. log4j.xml or log4j.properties) is NOT found in the classpath. Placing the log4j configuration file in the applications classpath should solve the issue.

is this important?

Depends on requirement, if you want messages logged to a file with defined levels, then yes you need to fix this warning. Otherwise you may ignore.

Upvotes: 3

Related Questions