IDEA Tomcat 控制台乱码解决方法大全

IDEA Tomcat 控制台乱码解决方法大全

因为每个人的生产环境不一样,所以产生乱码的原因也,不一样,但是总共就那么几种可能,所以我全列出来

IDEA配置

Editor – File Encodings

全选UTF-8
在这里插入图片描述

Editor – Editor – General – Console

箭头项配置为UTF-8
在这里插入图片描述

VM虚拟机配置

点击图中高亮,进入idea64.exe.vmoptions, 在配置文件中加入-Dfile.encoding=UTF-8
在这里插入图片描述

Tomcat配置

IDEA中的配置项

在这里插入图片描述

Tomcat配置文件

进入Tomcat安装路径 – conf文件夹 – 打开logging.properties,将里面所有的GBK改为UTF-8

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.encoding = UTF-8

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.encoding = UTF-8

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.encoding = UTF-8

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.encoding = UTF-8

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter
java.util.logging.ConsoleHandler.encoding = UTF-8

最后

我只知道这么多了,欢迎评论区补充


版权声明:本文为weixin_45479740原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。