idea 控制檯log日誌中文亂碼解決方案

一、開發工具概況

開發工具概況
JDK 1.8
Tomcat 7.0.92
IntelliJ IDEA 2018.2.1

二、亂碼問題展示(部分內容)

······

浜旀湀 31, 2019 2:01:53 涓嬪崍 org.apache.catalina.startup.TaglibUriRule body
淇℃伅: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
浜旀湀 31, 2019 2:01:53 涓嬪崍 org.apache.catalina.startup.TaglibUriRule body
淇℃伅: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
浜旀湀 31, 2019 2:01:53 涓嬪崍 org.apache.catalina.startup.TaglibUriRule body
淇℃伅: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
浜旀湀 31, 2019 2:01:53 涓嬪崍 org.apache.catalina.startup.TaglibUriRule body
淇℃伅: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
浜旀湀 31, 2019 2:01:53 涓嬪崍 org.apache.catalina.startup.TldConfig execute
淇℃伅: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
[2019-05-31 02:01:53,706] Artifact DataExchangeCenter_xj:war exploded: Artifact is deployed successfully
[2019-05-31 02:01:53,707] Artifact DataExchangeCenter_xj:war exploded: Deploy took 5,301 milliseconds

三、解決方案

方法a、

         修改tomcat的配置文件   apache-tomcat-7.0.92\conf\logging.properties 

         將所有的 ···.encoding = UTF-8   改爲   ···.encoding = GBK  重啓服務即可。

############################################################

1catalina.org.apache.juli.FileHandler.level = FINE
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.
1catalina.org.apache.juli.AsyncFileHandler.encoding = GBK

2localhost.org.apache.juli.FileHandler.level = FINE
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.
2localhost.org.apache.juli.AsyncFileHandler.encoding = GBK

3manager.org.apache.juli.FileHandler.level = FINE
3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.FileHandler.prefix = manager.
3manager.org.apache.juli.AsyncFileHandler.encoding = GBK

4host-manager.org.apache.juli.FileHandler.level = FINE
4host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
4host-manager.org.apache.juli.FileHandler.prefix = host-manager.
4host-manager.org.apache.juli.AsyncFileHandler.encoding = GBK

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.ConsoleHandler.encoding = GBK


############################################################

效果展示:

五月 31, 2019 1:55:36 下午 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined
五月 31, 2019 1:55:36 下午 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
五月 31, 2019 1:55:36 下午 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
五月 31, 2019 1:55:36 下午 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
五月 31, 2019 1:55:36 下午 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
五月 31, 2019 1:55:36 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
[2019-05-31 01:55:37,824] Artifact EnterpriseQuerySystem:war exploded: Artifact is deployed successfully
[2019-05-31 01:55:37,824] Artifact EnterpriseQuerySystem:war exploded: Deploy took 3,762 milliseconds

改後出現個問題,之前   System.out.println(time);  中文不亂碼,現在亂碼了,暫未 解決

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章