当前位置:网站首页>idea去掉spark的日志
idea去掉spark的日志
2022-08-04 13:52:00 【我要用代码向我喜欢的女孩表白】
spark默认会答应info,信息,他内置有log4j
故,我们有3种方式解决
1.直接在代码里设置日志级别,包含直接类中添加,和使用继承类(不推荐)
2.修改他的全局配置(不推荐)
3.添加log4j.prperties
注意,pom里面不能有其他的日志
尤其是这2个,要删除,否则会导致你设置的log4j.proerpties失效
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.25</version>
<scope>compile</scope>
</dependency>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>这里我们采用第三种
创建一个这样的文件,名称也要一样

给文件添加内容
log4j.rootCategory=ERROR, console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.target=System.err
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n
# Set the default spark-shell log level to ERROR. When running the spark-shell, the # log level for this class is used to overwrite the root logger's log level, so that
# the user can have different defaults for the shell and regular Spark apps.
log4j.logger.org.apache.spark.repl.Main=ERROR
# Settings to quiet third party logs that are too verbose
log4j.logger.org.spark_project.jetty=ERROR
log4j.logger.org.spark_project.jetty.util.component.AbstractLifeCycle=ERROR
log4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=ERROR
log4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=ERROR
log4j.logger.org.apache.parquet=ERROR
log4j.logger.parquet=ERROR
# SPARK-9183: Settings to avoid annoying messages when looking up nonexistent UDFs in SparkSQL with Hive support
log4j.logger.org.apache.hadoop.hive.metastore.RetryingHMSHandler=FATAL
log4j.logger.org.apache.hadoop.hive.ql.exec.FunctionRegistry=ERROR测试前

测试后

边栏推荐
猜你喜欢

小 P 周刊 Vol.13

Programmer Qixi Gift - How to quickly build an exclusive chat room for your girlfriend in 30 minutes

Interviewer: How to view files containing abc string in /etc directory?

zabbix自定义图形

电子行业MES管理系统有哪些特殊功能

Analysis and application of portrait segmentation technology

从理论到实践:MySQL性能优化和高可用架构,一次讲清

用过Apifox这个API接口工具后,确实感觉postman有点鸡肋......

c#之winform(软件开发)

MySQL性能指标TPS\QPS\IOPS如何压测?
随机推荐
文字编码 - Markdown 简明教程
[Niu Ke brush questions-SQL big factory interview questions] NO5. Analysis of a treasure store (e-commerce model)
AlphaFold 如何实现 AI 在结构生物学中的全部潜力
vcl啥意思_oval
节省50%成本!京东云重磅发布新一代混合CDN产品
小 P 周刊 Vol.13
router---Programmatic navigation
一文梳理NLP主要模型发展脉络
[UML] Summary of Information System Analysis and Design Knowledge Points
idea permanent activation tutorial (new version)
SMART S7-200PLC串行自由口通讯(耐压测试仪)
Execution failed for task ‘:xxx:generateReleaseRFile‘.
Niuke.com Brush Question Record || Linked List
Various problems with npm install
nVisual二次开发——第二章 nVisual API操作指南Swagger使用
第四讲 SVN
南瓜科学产品升级 开启益智探索新篇章
MPLS experiment
Week 7 Latent Variable Models and Expectation Maximization
router---动态路由匹配