Logging messages from agent plugin to Build Log
Hi,
I am working on an agent Plugin which is currently logging messages to a Log file as configured in build agent's log4j.xml file. But i need to log these messages in the build Log.
I saw the documentation about using Service messages or teamcity-info.xml file. I am not clear about how to go about this.
Can you please provide more info on how to get these messages logged in Teamcity's Build Log ?
Thanks,
Smitha
Please sign in to leave a comment.
You should have a AgentRunningBuild instance, from it you can obtain BuildProgressLogger: use getBuildLogger() method.
If you need to log a message use the following call:
build.getBuildLogger().message(msg);
Thanks Pavel.
That worked!
-Smitha