No appenders could be found for logger(log4j)?

0 votes

I have put log4j to my buildpath, but I get the message like, 

No appenders could be found for logger (dao.hsqlmanager)

when I run my application. How to solve this problem?

Jun 29, 2018 in Java by Daisy
• 8,090 points

1 answer to this question.

0 votes

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
answered Jun 29, 2018 by Akrati
• 3,150 points

Related Questions In Java

0 votes
1 answer

"No mapping found for HTTP request with URI[....] in DispatherServlet"

Your standard Spring MVC application will serve ...READ MORE

answered Jun 6, 2018 in Java by prasad
• 160 points
0 votes
1 answer

JsonMappingException: No suitable constructor found for type [simple type, class ]: can not instantiate from JSON object?

Hello @kartik, his happens for these reasons: your inner ...READ MORE

answered Apr 8 in Java by Niroj
• 21,360 points
0 votes
1 answer

Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved

Check the maven repository server is up. Check ...READ MORE

answered Jun 25, 2018 in Java by Sushmita
• 6,890 points
0 votes
1 answer

Android Studio installation on Windows 7 fails, no JDK found

Adding a system variable JDK_HOME with value ...READ MORE

answered Dec 13, 2018 in Java by Daisy
• 8,090 points
0 votes
1 answer

How to solve this error: No Persistence provider for EntityManager named

After <persistence-unit name="agisdb">, define the persis ...READ MORE

answered Jan 8, 2019 in Java by Daisy
• 8,090 points
0 votes
2 answers

Send HTTP request in Java

import; import; import; import; import; import; import ...READ MORE

answered Aug 3, 2018 in Java by samarth295
• 2,190 points
+1 vote
11 answers

How to send HTTP POST requests on Java?

How to invoke Thread dump analysis API? Invoking ...READ MORE

answered Jun 16, 2019 in Java by Jim
• 810 points

reshown Jun 17, 2019 by Vardhan 48,763 views
0 votes
2 answers

Performing HTTP POST operation in JAVA

I'm using JSON-Java to build my JSON object: JSONObject json ...READ MORE

answered Nov 26, 2018 in Java by Sushmita
• 6,890 points
0 votes
10 answers

Java - sending HTTP parameters via POST method easily

I personally use Apache's HTTPClient/HttpCore libraries to do ...READ MORE

answered Dec 10, 2018 in Java by robocop
0 votes
1 answer

Which is the best GUI designer for Eclipse?

Windows Builder Pro is the best GUI ...READ MORE

answered May 21, 2018 in Java by Akrati
• 3,150 points