Tomcat 启动日志乱码_Tomcat 重新安装了JDK8+IDEA 2018.2.5, 新建Web项目,启动日志出现了乱码!

ps:重新安装了JDK8+IDEA 2018.2.5, 新建Web项目,启动日志出现了乱码!

27-Sep-2019 13:50:14.053 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Server.鏈嶅姟鍣ㄧ増鏈�:        Apache Tomcat/8.5.46
27-Sep-2019 13:50:14.055 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log 鏈嶅姟鍣ㄦ瀯寤�: Sep 16 2019 18:16:19 UTC
27-Sep-2019 13:50:14.055 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 8.5.46.0
27-Sep-2019 13:50:14.055 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 7
27-Sep-2019 13:50:14.056 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log OS.鐗堟湰: 6.1
27-Sep-2019 13:50:14.056 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log 鏋舵瀯: amd64
27-Sep-2019 13:50:14.056 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Java 鐜鍙橀噺: C:\Program Files\Java\jdk1.8.0_201\jre
27-Sep-2019 13:50:14.056 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM 鐗堟湰: 1.8.0_201-b09
27-Sep-2019 13:50:14.056 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM.渚涘簲鍟�: Oracle Corporation
27-Sep-2019 13:50:14.056 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\Administrator\.IntelliJIdea2018.2\system\tomcat\index_jsp_webTest01
27-Sep-2019 13:50:14.056 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\apache-tomcat-8.5.46
27-Sep-2019 13:50:14.056 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\Administrator\.IntelliJIdea2018.2\system\tomcat\index_jsp_webTest01\conf\logging.properties
27-Sep-2019 13:50:14.056 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
27-Sep-2019 13:50:14.056 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
27-Sep-2019 13:50:14.056 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
27-Sep-2019 13:50:14.057 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
27-Sep-2019 13:50:14.057 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
27-Sep-2019 13:50:14.057 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
27-Sep-2019 13:50:14.057 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
27-Sep-2019 13:50:14.057 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
27-Sep-2019 13:50:14.057 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
27-Sep-2019 13:50:14.057 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\Administrator\.IntelliJIdea2018.2\system\tomcat\index_jsp_webTest01
27-Sep-2019 13:50:14.057 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\apache-tomcat-8.5.46
27-Sep-2019 13:50:14.057 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\apache-tomcat-8.5.46\temp
27-Sep-2019 13:50:14.057 淇℃伅 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk1.8.0_201\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\MySP\绯荤粺璋冭瘯\;C:\MySP\甯哥敤杞欢\;C:\MySP\璋冭瘯宸ュ叿;C:\MySP\纭欢妫�娴媆;C:\MySP\杩滅▼宸ュ叿\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;.]
27-Sep-2019 13:50:14.183 淇℃伅 [main] org.apache.coyote.AbstractProtocol.init 鍒濆鍖栧崗璁鐞嗗櫒 ["http-nio-8080"]
27-Sep-2019 13:50:14.203 淇℃伅 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
27-Sep-2019 13:50:14.217 淇℃伅 [main] org.apache.coyote.AbstractProtocol.init 鍒濆鍖栧崗璁鐞嗗櫒 ["ajp-nio-8009"]
27-Sep-2019 13:50:14.232 淇℃伅 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
27-Sep-2019 13:50:14.233 淇℃伅 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 505 ms
27-Sep-2019 13:50:14.268 淇℃伅 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
27-Sep-2019 13:50:14.268 淇℃伅 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.46
27-Sep-2019 13:50:14.279 淇℃伅 [main] org.apache.coyote.AbstractProtocol.start 寮�濮嬪崗璁鐞嗗彞鏌刐"http-nio-8080"]
27-Sep-2019 13:50:14.295 淇℃伅 [main] org.apache.coyote.AbstractProtocol.start 寮�濮嬪崗璁鐞嗗彞鏌刐"ajp-nio-8009"]
27-Sep-2019 13:50:14.301 淇℃伅 [main] org.apache.catalina.startup.Catalina.start Server startup in 67 ms
27-Sep-2019 13:50:24.283 淇℃伅 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory 鎶妛eb 搴旂敤绋嬪簭閮ㄧ讲鍒扮洰褰� [C:\apache-tomcat-8.5.46\webapps\manager]
27-Sep-2019 13:50:24.337 淇℃伅 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\apache-tomcat-8.5.46\webapps\manager] has finished in [53] ms

感觉看着好别扭!

这是一个小问题!设置一下tomcat服务器的日志编码集就好了!

解决办法:找到 Tomcat/conf/目录下,打开logging.properties修改

java.util.logging.ConsoleHandler.encoding = utf-8为

java.util.logging.ConsoleHandler.encoding = GBK


修改后如下:

C:\apache-tomcat-8.5.46\bin\catalina.bat run
[2019-09-27 01:59:59,142] Artifact web:war exploded: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE: "C:\Users\Administrator\.IntelliJIdea2018.2\system\tomcat\index_jsp_webTest01"
Using CATALINA_HOME: "C:\apache-tomcat-8.5.46"
Using CATALINA_TMPDIR: "C:\apache-tomcat-8.5.46\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_201"
Using CLASSPATH: "C:\apache-tomcat-8.5.46\bin\bootstrap.jar;C:\apache-tomcat-8.5.46\bin\tomcat-juli.jar"
27-Sep-2019 14:00:00.116 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server.服务器版本: Apache Tomcat/8.5.46
27-Sep-2019 14:00:00.121 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 服务器构建: Sep 16 2019 18:16:19 UTC
27-Sep-2019 14:00:00.121 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 8.5.46.0
27-Sep-2019 14:00:00.121 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 7
27-Sep-2019 14:00:00.121 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS.版本: 6.1
27-Sep-2019 14:00:00.121 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 架构: amd64
27-Sep-2019 14:00:00.121 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java 环境变量: C:\Program Files\Java\jdk1.8.0_201\jre
27-Sep-2019 14:00:00.121 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM 版本: 1.8.0_201-b09
27-Sep-2019 14:00:00.121 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM.供应商: Oracle Corporation
27-Sep-2019 14:00:00.121 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\Administrator\.IntelliJIdea2018.2\system\tomcat\index_jsp_webTest01
27-Sep-2019 14:00:00.122 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\apache-tomcat-8.5.46
27-Sep-2019 14:00:00.122 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\Administrator\.IntelliJIdea2018.2\system\tomcat\index_jsp_webTest01\conf\logging.properties
27-Sep-2019 14:00:00.122 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
27-Sep-2019 14:00:00.122 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
27-Sep-2019 14:00:00.122 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
27-Sep-2019 14:00:00.122 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
27-Sep-2019 14:00:00.122 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
27-Sep-2019 14:00:00.122 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
27-Sep-2019 14:00:00.122 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
27-Sep-2019 14:00:00.122 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
27-Sep-2019 14:00:00.122 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
27-Sep-2019 14:00:00.123 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\Administrator\.IntelliJIdea2018.2\system\tomcat\index_jsp_webTest01
27-Sep-2019 14:00:00.123 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\apache-tomcat-8.5.46
27-Sep-2019 14:00:00.123 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\apache-tomcat-8.5.46\temp
27-Sep-2019 14:00:00.123 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk1.8.0_201\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\MySP\系统调试\;C:\MySP\常用软件\;C:\MySP\调试工具;C:\MySP\硬件检测\;C:\MySP\远程工具\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;.]
27-Sep-2019 14:00:00.259 信息 [main] org.apache.coyote.AbstractProtocol.init 初始化协议处理器 ["http-nio-8080"]
27-Sep-2019 14:00:00.280 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
27-Sep-2019 14:00:00.291 信息 [main] org.apache.coyote.AbstractProtocol.init 初始化协议处理器 ["ajp-nio-8009"]
27-Sep-2019 14:00:00.296 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
27-Sep-2019 14:00:00.297 信息 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 514 ms
27-Sep-2019 14:00:00.334 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
27-Sep-2019 14:00:00.335 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.46
27-Sep-2019 14:00:00.356 信息 [main] org.apache.coyote.AbstractProtocol.start 开始协议处理句柄["http-nio-8080"]
27-Sep-2019 14:00:00.374 信息 [main] org.apache.coyote.AbstractProtocol.start 开始协议处理句柄["ajp-nio-8009"]
27-Sep-2019 14:00:00.381 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 84 ms
Connected to server
[2019-09-27 02:00:00,735] Artifact web:war exploded: Artifact is being deployed, please wait...
[2019-09-27 02:00:01,056] Artifact web:war exploded: Artifact is deployed successfully
[2019-09-27 02:00:01,056] Artifact web:war exploded: Deploy took 321 milliseconds
27-Sep-2019 14:00:10.371 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory 把web 应用程序部署到目录 [C:\apache-tomcat-8.5.46\webapps\manager]
27-Sep-2019 14:00:10.416 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\apache-tomcat-8.5.46\webapps\manager] has finished in [45] ms


OK!完美解决!


绿衣捧研催题卷,红袖添香伴读书!