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); 中文不乱码,现在乱码了,暂未 解决