当前位置:网站首页>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
测试前
测试后
边栏推荐
猜你喜欢
考研上岸又转行软件测试,从5k到13k完美逆袭,杭州校区小哥哥拒绝平庸终圆梦!
第六届未来网络发展大会,即将开幕!
AutoCAD DWG,DXF文件导出高清图片、PDF
如何才能有效、高效阅读?猿辅导建议“因材因时施教”
代码越写越乱?那是因为你没用责任链!
SCA兼容性分析工具(ORACLE/MySQL/DB2---&gt;MogDB/openGauss/PostgreSQL)
"Social Enterprises Conducting Civilian Personnel Training Specifications" group standard on the shelves of Xinhua Bookstore
Redis 复习计划 - Redis主从数据一致性和哨兵机制
MySQL性能指标TPS\QPS\IOPS如何压测?
【WeChat Mini Program】Social Internship Production Project for Information Management and Information System Major--Trash Fingerprint
随机推荐
考研上岸又转行软件测试,从5k到13k完美逆袭,杭州校区小哥哥拒绝平庸终圆梦!
JSX use
如何才能有效、高效阅读?猿辅导建议“因材因时施教”
(记录)异步并发,多线程处理表的统计
小 P 周刊 Vol.13
Cockpit human-computer interaction "undercurrent", voice "down", multi-modal "up"
Map常见的遍历方式-keySet 和 entrySet
leetcode 48. Rotate Image (Medium)
开放麒麟 openKylin 版本规划敲定:10 月发布 0.9 版并开启公测,12 月发布 1.0 版
Week 7 Latent Variable Models and Expectation Maximization
Lecture 4 SVN
Is there a replacement for the LM2596?LM2576 can
Convolutional Neural Network Basics
烂大街的缓存穿透、缓存击穿和缓存雪崩,你真的懂了?
c#之winform(软件开发)
浙江大学团队使用基于知识图谱的新方法,从空间分辨转录组数据中推断细胞间通信状况
自监督学习未来是掩码自编码器?KAIST最新《自监督学习掩码自编码器》研究进展
php中的ceil和floo以及round函数「建议收藏」
Interviewer: Tell me the difference between NIO and BIO
eyb:JWT介绍