2

I'm troubleshooting a build step in TeamCity 9.0.4. The problem seems to lie within the service message output. Is it possible to view these after the build has completed? They are not included in the build log.

The documentation on service messages simply says In order to be processed by TeamCity, they should be printed into a standard output stream of the build. https://confluence.jetbrains.com/display/TCD9/Build+Script+Interaction+with+TeamCity

(To some extent the service messages can be viewed by manually rerunning the build step and monitoring standard output, but this is not always feasible.)

MEMark
  • 1,493
  • 2
  • 22
  • 32
  • Odd; all service message output is logged in my builds (using the 'All Messages' filter). Are you sure your service messages are actually being written? – SteveChapman Jun 22 '15 at 16:24

2 Answers2

1

The documentation for service message implies that you need to write service messages to standard out/error rather than to a log file. If you write it to standard out, teamcity will automatically pick it up and show it in the **build logs ** tab

What this means is that if you have a

  1. shell script, use echo for your service messages
  2. java class, use System.out.println and so on

Different languages also have different plugins for this , for ex perl has TapHarness.pl to write teamcity messages to the console.

EDIT:

If you want to just view service messages , you can find them in the build logs on the teamcity agent that the build ran on. If you do not find them in the build logs , either the build log has rolled over or you need to increase the verbosity or debug level of your logs(depends on the language).

Biswajit_86
  • 3,661
  • 2
  • 22
  • 36
  • 1
    Thanks for your reply, but this does not answer my question. I don't want to write service messages, I want to read them. They are not visible in the build log AFAICT. This is my question: `The problem seems to lie within the service message output. Is it possible to view these after the build has completed? ` – MEMark Jun 22 '15 at 06:26
1

There was a problem which is solved nowdays:

TeamCity now parses service messages inside other service messages, but only if original message was tagged with tc:parseServiceMessagesInside. Example:

##teamcity[testStdOut name='test1' out='##teamcity|[buildStatisticValue key=|'my_stat_value|' value=|'125|'|]' tc:tags='tc:parseServiceMessagesInside']

A link to JetBrains bug tracker: https://youtrack.jetbrains.com/issue/TW-45311

Sergei Voitovich
  • 2,804
  • 3
  • 25
  • 33