Need logging of TeamCity Build Triggers

We use TeamCity 7.1 for continuous integration, and we produce build logs and artifacts for each build. We created a special build trigger of our own. It runs several times a day on several different configurations. But every now and then it fails to initiate a build, and we are trying to determine why. We want to log the output of the trigger itself. Is it possible to generate a log from the build trigger, even if a build doesn't run as a result of the trigger? Thanks.

Comment actions Permalink

Hi Nash,

The usual way it to use log4j logging in the code of your plugin:

or use own logger by:
add into your class:
final static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getInstance(your_class_name.class.getName());
Log messages:"message");
And add into <TeamCity home>\conf\teamcity-server-log4j.xml
A category above <root> node:
  <category name="your_full_package_or_full_class_name">
    <priority value="INFO"/>
    <appender-ref ref="ROLL"/>

BTW, just out of curiosity, if you trigger is generic enough, could you please detail what it does?

Message was edited by: Yegor Yarko

Comment actions Permalink

It is actually this plugin described here: which it appears you helped on as well. This should work, I'll have to impliment and make sure it does.



Comment actions Permalink

Will I need to import anything in order to be able to use the ""message"); " to log?



Comment actions Permalink


Actually, it should read jetbrains.buildServer.log.Loggers.SERVER.log(...), sorry for the omission. Just the class, nothing else should be necessary.

Comment actions Permalink

Alright, I got the log4j.jar file from here, , and added it to my Java Build Path, but now I'm getting these errors:

"The type com.intellij.openapi.diagnostic.Logger cannot be resolved. It is indirectly referenced from required .class files"


"Logger cannot be resolved to a type"

Are these related to that or is that something else?

Thanks so much for the help.


Please sign in to leave a comment.