Log4j No appenders could be found for logger (org.apache.hadoop.util.shell) Log4j No appenders could be found for logger (org.apache.hadoop.util.shell) hadoop hadoop

Log4j No appenders could be found for logger (org.apache.hadoop.util.shell)


For Maven you have to put the log4j.properties or log4j.xml file in main/resources folder. that's it. nothing else to do. Create your own property file. Something like this.

log4j.rootLogger=DEBUG, CAlog4j.appender.CA=org.apache.log4j.ConsoleAppenderlog4j.appender.CA.layout=org.apache.log4j.PatternLayoutlog4j.appender.CA.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

You can give INFO, ERROR, WARNING, FATAL and DEBUG to the log4j.rootlogger property. replace debug with whichever mode of logs suits the best for your needs.


Follow the URL given in the warning. It will given some guiding information.

http://logging.apache.org/log4j/1.2/faq.html#noconfig

From the site:

This occurs when the default configuration files log4j.properties and log4j.xml can not be found and the application performs no explicit configuration. log4j uses Thread.getContextClassLoader().getResource() to locate the default configuration files and does not directly check the file system. Knowing the appropriate location to place log4j.properties or log4j.xml requires understanding the search strategy of the class loader in use. log4j does not provide a default configuration since output to the console or to the file system may be prohibited in some environments.

You need either a log4j.properties or log4j.xml. Construct either that suits your need best. Read the Log4J manual will give you some knowledge to help construct the config file