当前位置:网站首页>解决执行MapReduce程序控制台没有日志信息WARN Please initialize the log4j system properly
解决执行MapReduce程序控制台没有日志信息WARN Please initialize the log4j system properly
2022-06-24 18:32:00 【盛世如恋】
运行mapreduce的时候,发现没有日志文件,会提示警告:
log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

发现控制台重来没有输出过mapreduce的任务信息情况。后来发现需要配置log4j。
在resource目录下创建一个log4j.properties文件
添加如下信息:
log4j.rootLogger=info, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n
log4j.appender.File=org.apache.log4j.DailyRollingFileAppender
log4j.appender.File.File=D:/test/logs.txt
log4j.appender.File.DatePattern='_'yyyy-MM-dd'.txt'
log4j.appender.File.layout=org.apache.log4j.PatternLayout
log4j.appender.File.layout.ConversionPattern=%d %t %-5p [%c] %m%n

边栏推荐
- Leetcode topic [array] -46- full arrangement
- variable
- Implementation of pure three-layer container network based on BGP
- Analysis on the issue of raising the right of MSSQL in 2021 secondary vocational group network security competition in Shandong Province
- Ten excellent business process automation tools for small businesses
- Overall planning and construction method of digital transformation
- 电子元器件行业B2B电商市场模式、交易能力数字化趋势分析
- Wechat applet development - Implementation of rotation chart
- Gateway solves cross domain access
- 13 ways to reduce the cost of cloud computing
猜你喜欢
About swagger

Get the actual name of the method parameter through the parameter

Nine practical guidelines for improving responsive design testing
Using flex to implement common layouts

(Video + graphics) introduction to machine learning series - Chapter 11 support vector machines
![717.1-bit and 2-bit characters [sliding window]](/img/61/449566d2a8efbd403ae0361f839683.jpg)
717.1-bit and 2-bit characters [sliding window]
Millions of dollars worth of NFT were stolen in the attack, and Google issued an emergency warning to 3.2 billion users worldwide | February 21 global network security hotspot
R language Quantitative Ecology redundancy analysis RDA analysis plant diversity species data visualization

国家出手了!对知网启动网络安全审查

Different JVM
随机推荐
Business based precipitation component = & gt; manage-table
Flutter dart regular regexp matches non printing characters \cl\cj\cm\ck
Skills of writing test cases efficiently
Network security database penetration of secondary vocational group in 2022
Install MySQL using Yum for Linux
2022 network security C module of the secondary vocational group scans the script of the surviving target aircraft (municipal, provincial and national)
Sword finger offer 10- ii Frog jumping on steps
How do yaml files and zmail collide with the spark of the framework, and how can code and data be separated gracefully?
Three layer switching experiment
Easynvr fails to use onvif to detect the device. What is the reason why "no data" is displayed?
Software testing methods: a short guide to quality assurance (QA) models
On the principle of cloud streaming multi person interaction technology
Considerations for it project demand analysis
Design topic: MATLAB cellular automata personnel evacuation
Selection (031) -cool_ How long can secret be accessed?
Business leaders compete for CIO roles
What is decision intelligence?
What are the grades of financial products?
Easyplayer streaming media player plays HLS video. Technical optimization of slow starting speed
What makes data analysts good- Cassie Kozyrkov