we want to interact with build logs to fetch some data from logs.
could you please provide the API using which we can interact with logs and also the example we can use the API in groovy script.
Description
hi Robin,
we want to interact with build logs to fetch some data from logs.
could you please provide the API using which we can interact with logs and also the example we can use the API in groovy script.
Robin Shen[23/Oct/23 11:30 PM]
For a finished build, you may run below groovy script on SERVER:
groovy:
def logContent = build.renderLogAsText();
// do whatever with logContent
An appropriate place to run the groovy script would be on the post-build script in advanced setting of the configuration.
rani dharne [25/Oct/23 05:11 AM]
Hi Robin,
Thanks for your response.
are there no any other way to run the script on Server.
we can't run the build always on server.
groovy:
def logContent = build.renderLogAsText();
// do whatever with logContent
An appropriate place to run the groovy script would be on the post-build script in advanced setting of the configuration.