Log4j log output garbled characters in Linux-general Linux technology-Linux programming and kernel information. For details, refer to the following section. Currently, log4j is very popular. in the Windows system, garbled characters are not encountered. But recently, garbled characters have been encountered in the LINUX environment. in xml (I am using a configuration file in this format), set Attribute.
In addition:
1) I tested, only set the character encoding to "UTF-8", in order to solve the garbled problem, if set to: GB2312, GBK will still appear garbled;
2) You only need to set the character encoding here. You do not need to encode the content to be output in the program, and it does not help even encode the output content, there will still be garbled characters.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service