About Log4j:warn No Appenders could is found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory). Questions

Source: Internet
Author: User

The idea of writing Java code at the beginning of a few days, feeling very cool, so decided to abandon eclipse

---------------------------------------above is an off-topic--------

Today, when running a program, as shown in the problem, find the information is due to the log4j this log information print module configuration information is not given, the simple is that someone else should have a place to store the log printing information, but you do not give others, so on the error bar

Workaround:

Create a text file named Log4j.properties in the SRC directory of your project, remembering that it is a text file, not a folder

Then add the following content to your text file:

 for testing:optionally with log file    #log4j. Rootlogger=debug,appender  log4j.rootlogger=  Info,appender  #log4j. Rootlogger=error,appender    #\u8f93\u51fa\u5230\u63a7\u5236\u53f0  Log4j.appender.appender=org.apache.log4j.ConsoleAppender  #\u6837\u5f0f\u4e3attcclayout  Log4j.appender.appender.layout=org.apache.log4j.ttcclayout

About Log4j:warn No Appenders could is found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory). Questions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.