tomcat启动时,日志中文乱码问题

今天在搭环境启动tomcat时,出现如下乱码:

03-Sep-2019 16:46:59.752 淇℃伅 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\docs]
03-Sep-2019 16:47:03.868 璀﹀憡 [localhost-startStop-1] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [3,516] milliseconds.
03-Sep-2019 16:47:03.907 淇℃伅 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\docs] has finished in [4,155] ms
03-Sep-2019 16:47:03.908 淇℃伅 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\examples]
03-Sep-2019 16:47:05.092 淇℃伅 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\examples] has finished in [1,184] ms
03-Sep-2019 16:47:05.093 淇℃伅 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\host-manager]
03-Sep-2019 16:47:05.173 淇℃伅 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\host-manager] has finished in [80] ms
03-Sep-2019 16:47:05.174 淇℃伅 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\manager]
03-Sep-2019 16:47:05.256 淇℃伅 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\manager] has finished in [81] ms
03-Sep-2019 16:47:05.256 淇℃伅 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\ROOT]
03-Sep-2019 16:47:05.354 淇℃伅 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\ROOT] has finished in [98] ms
03-Sep-2019 16:47:05.364 淇℃伅 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8082"]
03-Sep-2019 16:47:05.389 淇℃伅 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8011"]
03-Sep-2019 16:47:05.397 淇℃伅 [main] org.apache.catalina.startup.Catalina.start Server startup in 5725 ms

然后通过更改conf---logging.properties配置文件中的java.util.logging.ConsoleHandler.encoding = UTF-8,将“UTF-8”改成“GBK”,再重启tomcat,然后我们发现,变回中文了

03-Sep-2019 16:51:24.183 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\docs] has finished in [4,159] ms
03-Sep-2019 16:51:24.184 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\examples]
03-Sep-2019 16:51:25.128 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\examples] has finished in [944] ms
03-Sep-2019 16:51:25.129 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\host-manager]
03-Sep-2019 16:51:25.206 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\host-manager] has finished in [77] ms
03-Sep-2019 16:51:25.207 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\manager]
03-Sep-2019 16:51:25.278 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\manager] has finished in [71] ms
03-Sep-2019 16:51:25.279 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\ROOT]
03-Sep-2019 16:51:25.379 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\software\apache-tomcat-8.5.45-3\webapps\ROOT] has finished in [100] ms
03-Sep-2019 16:51:25.406 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8082"]
03-Sep-2019 16:51:25.428 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8011"]
03-Sep-2019 16:51:25.435 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 5534 ms

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值