Teamcity build log
Asked Answered
F

5

10

I use TeamCity for continious integration. Solution checkouts on deploy machine and builds. Deploy machine running under Windows Server 2008 R2 - Russian. There are russian language PowerShell installed etc. In TeamCity build log, all russian symbols are in wrong encoding.

How to change encoding in build log?

Failsafe answered 9/2, 2012 at 15:2 Comment(0)
S
14
  1. change encoding for log4j configuration for build log in 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>
    
  2. add file.encoding=UTF-8 parameter launcher/conf/wrapper.conf that uses agent on start you should add it like that

    wrapper.app.parameter.6=-Dfile.encoding=UTF-8
    
  3. add -Dfile.encoding=UTF-8 in JAVA_OPTS

that steps helps me but now i have a bug - if you watching tail new Russian symbols in log replaced by "?". after refreshing the page they shown correct.

Stronski answered 11/3, 2012 at 12:30 Comment(1)
Additional reading: confluence.jetbrains.com/display/TCD7/…Lxx
B
14

For me, on Windows 7, TeamCity 9.0.3 helped adding "teamcity.runner.commandline.stdstreams.encoding=866" line into the buildAgent.properties file. I've got the encoding value by typing "chcp" in the command prompt.

Bouley answered 18/4, 2015 at 11:6 Comment(1)
It's helpful with Russian encoding. Thank you!Lampas
T
4

For Teamcity 9 the next had helped:

sudo dpkg-reconfigure locales
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8

(do this being on your agents)

After that - restart the agent:

./BuildAgent/bin/agent.sh stop
Theory answered 17/12, 2014 at 15:26 Comment(0)
R
1

For me, on TeamCity 7 and TeamCity 8, helped editing file teamcity-agent-log4j.xml:

<?xml version='1.0' encoding='UTF-8' ?>

and restarting TeamCity after that.

But encoding is correct only after refreshing the log page.

Restaurateur answered 27/8, 2013 at 8:2 Comment(0)
R
0

The simplest solution I've encountered so far is to go to your TeamCity project (not configuration) settings -> "Parameters" tab to the left -> Click "Add new parameter" -> select "Configuration parameter" -> set teamcity.runner.commandline.stdstreams.encoding to UTF-8 and hit "Save".

Now all logs in all build runs under this project will convert non-ascii characters through UTF-8. Note that this works in TeamCity 2017.1.4. Don't know if this is an option in earlier or later versions.

Radiophone answered 8/8 at 13:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.