找到Tomcat根目录下conf文件夹下的‘logging.properties’文件,用文本编辑器打开将其中的UTF-8改为GBK即可。
修改: 将UTF-8改为GBK。
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter
java.util.logging.ConsoleHandler.encoding = UTF-8
修改前:
08-May-2020 16:42:53.610 淇℃伅 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
08-May-2020 16:42:53.611 淇℃伅 [main] org.apache.catalina.core.StandardEngine.startInternal 姝e湪鍚姩 Servlet 寮曟搸锛歔Apache Tomcat/9.0.34]
08-May-2020 16:42:53.627 淇℃伅 [main] org.apache.coyote.AbstractProtocol.start 寮�濮嬪崗璁鐞嗗彞鏌刐"http-nio-8080"]
08-May-2020 16:42:53.643 淇℃伅 [main] org.apache.catalina.startup.Catalina.start Server startup in [84] milliseconds
修改后:
08-May-2020 16:45:41.282 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
08-May-2020 16:45:41.282 信息 [main] org.apache.catalina.core.StandardEngine.startInternal 正在启动 Servlet 引擎:[Apache Tomcat/9.0.34]
08-May-2020 16:45:41.304 信息 [main] org.apache.coyote.AbstractProtocol.start 开始协议处理句柄["http-nio-8080"]
08-May-2020 16:45:41.320 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in [91] milliseconds