当前位置:网站首页>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
测试前
测试后
边栏推荐
- ROS设置plugin插件
- "Social Enterprises Conducting Civilian Personnel Training Specifications" group standard on the shelves of Xinhua Bookstore
- 博途1200/1500PLC斜坡指令RAMP(带暂停功能)
- Convolutional Neural Network Basics
- AutoCAD DWG,DXF文件导出高清图片、PDF
- 异步编程概览
- router---dynamic route matching
- 化算力为战力:宁夏中卫的数字化转型启示录
- router---动态路由匹配
- 量化细胞内的信息流:机器学习时代下的研究进展
猜你喜欢
随机推荐
荧光磷脂PEG衍生物之一磷脂-聚乙二醇-荧光素,Fluorescein-PEG-DSPE
Convolutional Neural Network Basics
nVisual secondary development - Chapter 2 nVisual API operation guide Swagger use
router---Programmatic navigation
Week 7 Latent Variable Models and Expectation Maximization
LeetCode 1403 非递增顺序的最小子序列[贪心] HERODING的LeetCode之路
用过Apifox这个API接口工具后,确实感觉postman有点鸡肋......
js深拷贝和浅拷贝具体使用区别_es6深拷贝和浅拷贝
Script to get local IP address
字符串类的设计与实现_C语言字符串编程题
TS---类型设置
Analysis and application of portrait segmentation technology
router---Route guard
Utility function---string processing
大势所趋之下的nft拍卖,未来艺术品的新赋能
MySQL性能指标TPS\QPS\IOPS如何压测?
如何才能有效、高效阅读?猿辅导建议“因材因时施教”
metaRTC5.0新版本支持mbedtls(PolarSSL)
Interviewer: How to view files containing abc string in /etc directory?
烂大街的缓存穿透、缓存击穿和缓存雪崩,你真的懂了?