Asked  7 Months ago    Answers:  5   Viewed   295 times

I have put log4j to my buildpath, but I get the following message when I run my application:

log4j:WARN No appenders could be found for logger (dao.hsqlmanager).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See for more info.

What do these warnings mean? Whats the appender here?



This Short introduction to log4j guide is a little bit old but still valid.

That guide will give you some information about how to use loggers and appenders.

Just to get you going you have two simple approaches you can take.

First one is to just add this line to your main method:


Second approach is to add this standard (taken from the above mentioned guide) file to your classpath:

# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=DEBUG, A1

# A1 is set to be a ConsoleAppender.

# A1 uses PatternLayout.
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
Tuesday, June 1, 2021
answered 7 Months ago

If that's the entire file it looks like you're never actually creating a logger. You need a line like:

Monday, June 21, 2021
answered 6 Months ago

There are many possible options for specifying your log4j configuration. One is for the file to be named exactly "" and be in your classpath. Another is to name it however you want and add a System property to the command line when you start Java, like this:


All of them are outlined here

Sunday, August 1, 2021
answered 5 Months ago

Yes, presumably it wants the path to the javadoc command line tool that comes with the JDK (in the bin directory, same as java and javac).

Eclipse should be able to find it automatically; are you perhaps running it on a JRE? That would explain the request.

Saturday, September 4, 2021
answered 3 Months ago

Yes, this is a classpath issue. Log4j is looking for class com.lior.ibd.utils.logging.EclipseLoggingAppender. (probably appender that wrote someone in your organisation?)

If you remove lines:

 <appender name="eclipseErrorView" class="com.lior.ibd.utils.logging.EclipseLoggingAppender"/>


 <logger name="com.lior">
   <level value ="warn" /> 
   <appender-ref ref="eclipseErrorView" />

log4j should handle it.

Or add EclipseLoggingAppender to classpath by locating a appropriate jar file and add it to the classpath. I.e. run

java -cp appender.jar com.mypackage.MyClass
Thursday, November 4, 2021
Maxime VAST
answered 1 Month ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :