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,020 points
143 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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:

BasicConfigurator.configure();

Second approach is to add this standard log4j.properties (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.
log4j.appender.A1=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.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
2,053 views
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,820 points
144 views
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,020 points
43 views
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 in Java by Daisy
• 8,020 points
250 views
0 votes
1 answer

I am learning looping statements. Can you tell me how 'for-each' works in Java?

While programming we often write code that ...READ MORE

answered Apr 17, 2018 in Java by Rishabh
• 3,520 points
27 views
0 votes
2 answers

Send HTTP request in Java

import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpRequest; import com.google.api.client.http.HttpResponse; import com.google.api.client.http.HttpTransport; import com.google.api.client.http.javanet.NetHttpTransport; import java.io.IOException; import ...READ MORE

answered Aug 3, 2018 in Java by samarth295
• 2,190 points
69 views
0 votes
10 answers

How to send HTTP POST requests on Java?

You can use the function as HttpURLConnection.setRequestMethod( ...READ MORE

answered Dec 10, 2018 in Java by simplecode
9,221 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,820 points
498 views
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
4,591 views
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
117 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.