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.
Please sign in to leave a comment.
Hi Nash,
The usual way it to use log4j logging in the code of your plugin:
e.g.:
jetbrains.buildServer.log.Loggers.SERVER.info("message");
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:
LOG.info("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"/>
</category>
BTW, just out of curiosity, if you trigger is generic enough, could you please detail what it does?
Message was edited by: Yegor Yarko
It is actually this plugin described here: http://devnet.jetbrains.com/thread/436722?tstart=60 which it appears you helped on as well. This should work, I'll have to impliment and make sure it does.
Thanks!
Nash
Will I need to import anything in order to be able to use the "jetbrains.buildServer.log.SERVER.info("message"); " to log?
Thanks,
Nash
Nash,
Actually, it should read jetbrains.buildServer.log.Loggers.SERVER.log(...), sorry for the omission. Just the class, nothing else should be necessary.
Alright, I got the log4j.jar file from here, http://logging.apache.org/log4j/1.2/download.html , 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"
and
"Logger cannot be resolved to a type"
Are these related to that or is that something else?
Thanks so much for the help.