I use TeamCity for continuous integration. Testing solutions for machine deployment and assembly. Deploying a machine running Windows Server 2008 R2 - Russian. There is a Russian language PowerShell installed, etc. In the TeamCity build log, all Russian characters are erroneous.
How to change the encoding in the build log?
change the encoding for the log4j configuration for the build log conf/teamcity-agent-log4j.xml
conf/teamcity-agent-log4j.xml
<appender name="ROLL.BUILD" class="jetbrains.buildServer.util.TCRollingFileAppender"> <param name="file" value="${teamcity_logs}teamcity-build.log"/> <param name="Encoding" value="UTF-8"/> ... </appender>
add file.encoding = UTF-8 parameter launcher/conf/wrapper.conf , which the agent uses at startup, you must add it this way
launcher/conf/wrapper.conf
wrapper.app.parameter.6=-Dfile.encoding=UTF-8
add -Dfile.encoding=UTF-8 to JAVA_OPTS
-Dfile.encoding=UTF-8
JAVA_OPTS
that the steps help me, but now I have a mistake - if you see the tail of new Russian characters in the log, replaced by "?". after refreshing the page they showed correctly.
For me, in Windows 7, TeamCity 9.0.3 helped to add the line "teamcity.runner.commandline.stdstreams.encoding = 866" to the buildAgent.properties file. I have an encoding value by typing "chcp" on the command line.
For Teamcity 9, the following helped:
sudo dpkg-reconfigure locales sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
(do it on your agents)
After that - restart the agent:
./BuildAgent/bin/agent.sh stop
For me, on TeamCity 7 and TeamCity 8, I helped edit the teamcity-agent-log4j.xml file :
<?xml version='1.0' encoding='UTF-8' ?>
and then restart TeamCity.
But the encoding is correct only after updating the log page.