JAVA 集成开发环境----关于 Intellij IDEA 中 Tomcat 控制台日志中文乱码的解决

问题描述:

在 Intellij IDEA 中使用 Tomcat 时,控制台打印信息的日志中文显示为乱码,如下图所示;

解决办法

  • 设置 IDEA 编码为UTF-8(操作 : 点击 File--> Settings --> Editor --> File Encodings --> 全部设置为UTF-8(共有三处))
  • 设置 tomcat 日志编码为UTF-8(操作:tomcat 目录 /conf/logging.properties 设置 java.util.logging.ConsoleHandler.encoding = UTF-8)
  • 设置 IDEA vm options (操作: 点击 Help-- Edit custom vm options 添加-Dfile.encoding=UTF-8)

注意第三步设置要生效,需重启IDEA

posted @ 2021-10-08 17:47  雨 燕  阅读(76)  评论(0编辑  收藏  举报