log4j:WARN Error during default initialization

Posted 闲言_

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了log4j:WARN Error during default initialization相关的知识,希望对你有一定的参考价值。

错误产生环境

Mybatis 设置Log4j 日志时产生

错误描述

log4j:ERROR Category option " 1 " not a decimal integer.
java.lang.NumberFormatException: For input string: " 1 "

错误原因

在log4j.properties 文件中,的log4j.appender.console.layout.ConversionPattern属性多了空格

解决办法

修改前:

log4j.appender.console.layout.ConversionPattern =  %dABSOLUTE %5p %c 1 :%L - %m%n

修改后:

log4j.appender.console.layout.ConversionPattern =  %dABSOLUTE %5p %c1:%L - %m%n

以上是关于log4j:WARN Error during default initialization的主要内容,如果未能解决你的问题,请参考以下文章

log4j 告警:log4j:WARN No appenders could be found for logger

ERROR : Error appeared during Puppet run: 192.168.1.201_mariadb.pp

ERROR: Timeout on the Spark engine during the broadcast join

log4j:WARN Please initialize the log4j system properly解决的方法

log4j:WARN No appenders could be found for logger错误

log4j:WARN No appenders 警告