0

I have spring boot jar deployed as web app in Microsoft azure, this jar is generating rolling log files at wwwroot location and is printing chinese characters as ??? in log files. Is there a way to print proper chinese characers in the log files ?

PS: The chinese characters are printed properly in the console logs in my local machine.

user1635256
  • 111
  • 1
  • 11

2 Answers2

0

this jar is generating rolling log files at wwwroot location and is printing chinese characters as ???

I suggest you could try to set the default encoding on your server to UTF-8. For more details,you could refer to this article to solve the issue about chinese characters in spring boot.

Janley Zhang
  • 1,567
  • 7
  • 11
  • @user1635256 Could your provide related code or screenshot? – Janley Zhang Apr 10 '18 at 04:01
  • Its fixed by adding encoding UTF-8 to log4j. – user1635256 Apr 10 '18 at 04:09
  • What about this [article](https://stackoverflow.com/questions/27013487/how-to-change-testng-reporter-log-encoding-to-utf-16) and this [article](https://stackoverflow.com/questions/37356309/spring-security-remember-me-cookie-unicode-characters-wrong). – Janley Zhang Apr 10 '18 at 04:50
  • If my answer is still helpful, you could vote it up or mark it as answer to help other people find. Thanks. – Janley Zhang Apr 16 '18 at 01:38
0

I added UTF-8 encoding to my log4j2.xml and it worked.

<Configuration> <PatternLayout ..... charset="UTF-8"/> </Configuration>

user1635256
  • 111
  • 1
  • 11