log4j2 升级

1pct 使用 tomcat 启动,错误信息

Unable to inject fields into builder class for plugin type class org.apache.logging.log4j.core.appender.ConsoleAppender, element Console. java.nio.charset.UnsupportedCharsetException: sun.stdout.encoding

        at java.nio.charset.Charset.forName(Charset.java:531)

        at org.apache.logging.log4j.util.PropertiesUtil.getCharsetProperty(PropertiesUtil.java:146)

        at org.apache.logging.log4j.util.PropertiesUtil.getCharsetProperty(PropertiesUtil.java:134)

        at org.apache.logging.log4j.core.appender.ConsoleAppender$Target.getCharset(ConsoleAppender.java:85)

        at org.apache.logging.log4j.core.appender.ConsoleAppender$Target$1.getDefaultCharset(ConsoleAppender.java:71)

        at org.apache.logging.log4j.core.appender.ConsoleAppender$Builder.build(ConsoleAppender.java:218)

        at org.apache.logging.log4j.core.appender.ConsoleAppender$Builder.build(ConsoleAppender.java:185)

        at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)

        at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:952)

        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:892)

        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:884)

        at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:508)

        at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:232)

        at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:244)

        at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:545)

        at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:617)

        at org.apache.logging.log4j.core.LoggerContext.setConfigLocation(LoggerContext.java:603)

        at com.epichust.mestar.web.listener.MestarContextLoaderListener.contextInitialized(MestarContextLoaderListener.java:92)

#2 升级 log4j2 版本
image.png