log4j:WARN Error during default initialization [How to Solve]

Error generation environment

Generated when mybatis sets log4j log

Error description

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

Error reason

In the log4j.properties file, there are more spaces in the log4j.appender.console.layout.conversionpattern attribute

Solution:

Before modification:

log4j.appender.console.layout.ConversionPattern =  %d{ABSOLUTE} %5p %c{ 1 }:%L - %m%n

After modification:

log4j.appender.console.layout.ConversionPattern =  %d{ABSOLUTE} %5p %c{1}:%L - %m%n

Read More: