解决idea tomcat乱码问题
解决idea Server Output、TomcatLocalhost Log、Tomcat Catalina Log控制台乱码问题
问题原因:编码不一致,tomcat启动后默认编码UTF-8,而windows的默认编码是GBK。所以只需配置启动tomcat后为GBK编码即可。
# Describes specific configuration info for Handlers.
############################################################
1catalina.org.apache.juli.AsyncFileHandler.level = FINE
1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.
1catalina.org.apache.juli.AsyncFileHandler.maxDays = 90
1catalina.org.apache.juli.AsyncFileHandler.encoding = GBK
2localhost.org.apache.juli.AsyncFileHandler.level = FINE
2localhost.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.AsyncFileHandler.prefix = localhost.
2localhost.org.apache.juli.AsyncFileHandler.maxDays = 90
2localhost.org.apache.juli.AsyncFileHandler.encoding = GBK
3manager.org.apache.juli.AsyncFileHandler.level = FINE
3manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.AsyncFileHandler.prefix = manager.
3manager.org.apache.juli.AsyncFileHandler.maxDays = 90
3manager.org.apache.juli.AsyncFileHandler.encoding = GBK
4host-manager.org.apache.juli.AsyncFileHandler.level = FINE
4host-manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
4host-manager.org.apache.juli.AsyncFileHandler.prefix = host-manager.
4host-manager.org.apache.juli.AsyncFileHandler.maxDays = 90
4host-manager.org.apache.juli.AsyncFileHandler.encoding = GBK
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter
#java.util.logging.ConsoleHandler.encoding = GBK
java.util.logging.ConsoleHandler.encoding = GBK
############################################################
保存,然后重启tomcat就行了。
作者:梦里梦外
--------------------------------------------------------------------------------------------------------------------
个性签名:以梦为马,驰骋岁月;以梦为马,诗酒趁年华!
如果觉得这篇文章对你有小小的帮助的话,记得在右下角点个 “推荐” 哦,博主在此感谢!