No appenders could be found for logger(log4j)?

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 … Read more

What is the significance of log4j.rootLogger property in log4j.properties file? What happens if I don’t use this property?

Samudra Gupta explains in his book1: The Logger object is the main object that an application developer uses to log any message. The Logger objects acting within a particular instance of an application follow a parent-child hierarchy. If you have the following configuration: This is how the logger hierarchy could end up looking:2 Samudra Gupta continues to explain: At the … Read more

Difference between slf4j-log4j12 and log4j-over-slf4j

Use this if your code or some libraries you are using uses Log4j directly, but you want to use a different SLF4J binding than Log4j. It will route the Log4j API calls to SLF4J to the binding you choose. You need to remove the Log4j library from your classpath and replace it with this dependency. Use … Read more

Please initialize the log4j system properly warning

Alright, so I got it working by changing this to this Apparently you have to specify the logging level to the rootLogger first? I apologize if I wasted anyone’s time. Also, I decided to answer my own question because this wasn’t a classpath issue.

Please initialize the log4j system properly. While running web service

Those messages are something tricky, enough so that people created this to make it clearer: https://issues.apache.org/bugzilla/show_bug.cgi?id=25747 What’s tricky about them is that the warnings are written if Log4j can’t find its log4j.properties (or log4j.xml) file, but also if the file is fine and dandy but its content is not complete from a configuration point of view. The following paragraph … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)