当前位置:网站首页>解决执行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

边栏推荐
- SQL basic tutorial (learning notes)
- What is decision intelligence?
- 持续助力企业数字化转型-TCE获得国内首批数字化可信服务平台认证
- Continue to help enterprises' digital transformation -tce has obtained the certification of the first batch of digital trusted service platforms in China
- [golang] leetcode intermediate - jumping game & different paths
- Mental models: the best way to make informed decisions - farnam
- Recommend a distributed JVM monitoring tool, which is very practical!
- Tencent cloud won the "trusted cloud technology best practice - virtualization"
- Do you know CMDB?
- [can you really use es] Introduction to es Basics (I)
猜你喜欢

On software requirement analysis

How do yaml files and zmail collide with the spark of the framework, and how can code and data be separated gracefully?

It is often blocked by R & D and operation? You need to master the 8 steps before realizing the requirements
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
congratulate! The first dragon lizard community annual outstanding contribution award is announced. Check it now

How to create simple shapes in illustrator 2022

C language - structure II

Seven strategies for successfully integrating digital transformation
Issue 39: MySQL time class partition write SQL considerations

Nacos cluster starts throwing set of SQL_ SELECT_ LIMIT is not support
随机推荐
Four security issues of low code and no code development
Sword finger offer 10- ii Frog jumping on steps
Gateway solves cross domain access
Several key points for enterprises to pay attention to digital transformation
What is business intelligence (BI)?
Implementation of pure three-layer container network based on BGP
[can you really use es] Introduction to es Basics (I)
Project Management Guide: tips, strategies and specific practices
Complete Guide to web application penetration testing
Business leaders compete for CIO roles
Digital transformation informatization data planning and technology planning
He "painted" what a smart city should look like with his oars
On the principle of cloud streaming multi person interaction technology
Cloud service selection of enterprises: comparative analysis of SaaS, PAAS and IAAs
Introduction to yottastore, a new generation of storage engine for VPC TCE cos
Selection (033) - what is the output of the following code?
PHP WMI get hostname
Nine practical guidelines for improving responsive design testing
Two micro service interviews where small companies suffer losses
-Bash: wget: command not found