Solve the problem of garbled characters (Q℃伅璀﹀憡) in Tomcat under Idea

sequence

After we configure the Tomcat service ( see here for details ), we will always see information similar to this on the console

Obviously, this is garbled code. Although it does not affect normal project debugging, it looks very uncomfortable. Let us solve this problem in one step.

Problem Description

Console output information

12-Apr-2022 15:45:44.180 瀀﹀憡[main] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'URLEncoding' to 'UTF-8' did not find a matching property.
12-Apr-2022 15:45:44.213 Q℃伅[main] org.apache.catalina.startup.VersionLoggerListener.log Server. Link: Apache Tomcat/8.5.77
12 -Apr-2022 15:45:44.213 Q℃伅[main] org.apache.catalina.startup.VersionLoggerListener.log Chain嶅姟鍣ㄦ瀯夤�: Mar 13 2022 19:13:33 UTC 12
-Apr-2022 15 :45:44.213 Q℃伅[main] org.apache.catalina.startup.VersionLoggerListener.log The link is: 8.5.77.0
12-Apr-2022 15:45:44.213 Q℃伅[main] org.apache.catalina.startup.VersionLoggerListener.log Error: Windows 10

solution

I have found many solutions, but log files and console information can only solve one, not both. The best solution is given below.

1. Open the Tomcat installation directory and find the conf folder

2. Use Notepad to open the logging.properties file in the conf folder.

3. Modify all UTF-8 in the file to GBK and save

Operation verification

Restart Idea and debug again, check the console information

Garbled code situation has been resolved

Guess you like

Origin blog.csdn.net/m0_51269961/article/details/124126069