当前位置:网站首页>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测试前

测试后

边栏推荐
- How to find the location of a pdf file in endnote literature
- "Social Enterprises Conducting Civilian Personnel Training Specifications" group standard on the shelves of Xinhua Bookstore
- (记录)异步并发,多线程处理表的统计
- Script to get local IP address
- Utility function---string processing
- 人像分割技术解析与应用
- idea永久激活教程(新版)
- 搭建ros交叉编译环境(从x86到nvidia arm)
- 编程思想_编程有必要给孩子学吗?
- 错误 AttributeError type object 'Callable' has no attribute '_abc_registry' 解决方案
猜你喜欢

Week 7 Latent Variable Models and Expectation Maximization

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

Win11快速助手在哪里?Win11打开快速助手的方法

一文梳理NLP主要模型发展脉络

【毕设选题推荐】机器人工程专业毕设选题推荐

Is there a replacement for the LM2596?LM2576 can

手搓一个“七夕限定”,用3D Engine 5分钟实现烟花绽放效果
![[Niu Ke brush questions-SQL big factory interview questions] NO5. Analysis of a treasure store (e-commerce model)](/img/9f/33e782b93fcaa15359450e59a7233d.png)
[Niu Ke brush questions-SQL big factory interview questions] NO5. Analysis of a treasure store (e-commerce model)
将 Sentinel 熔断限流规则持久化到 Nacos 配置中心

Haproxy搭建web群集
随机推荐
Redis 复习计划 - Redis主从数据一致性和哨兵机制
七夕当然要学会SQL优化好早点下班去找对象
《C 陷阱与缺陷 》阅读概要
idea永久激活教程(新版)
Script to get local IP address
干掉visio,这个画图神器真的绝了
异步编程概览
sqlplus报错ORA-12547: TNS:lost contact解决
工具函数---字符串处理
文字编码 - XML 教程
Various problems with npm install
RT-Thread stm32 基础记录
MySQL性能指标TPS\QPS\IOPS如何压测?
PAT甲级:1038 Recover the Smallest Number
《中国综合算力指数》《中国算力白皮书》《中国存力白皮书》《中国运力白皮书》在首届算力大会上重磅发出
字符串类的设计与实现_C语言字符串编程题
Interviewer: How to view files containing abc string in /etc directory?
VBS函数应用–getobject的使用获得Automation对象
第四讲 SVN
搭建ros交叉编译环境(从x86到nvidia arm)