Reputation: 13051
How can I display build timestamps for each line of a multi-branch pipeline project? Is it a supported feature? If yes, does it need to be enabled in the Jenkinsfile
or is there a GUI option?
Upvotes: 85
Views: 81681
Reputation: 3877
To enable Timestamper globally (all builds):
-> Select the "Enabled for all Pipeline builds" checkbox.
Upvotes: 2
Reputation: 456
I'm wondering why roomsg's comment on the accepted answer didn't become an answer.
I just noticed that (at least in our setup) you can configure this globally: check the "Enabled for all Pipeline builds" in the "Timestamper" section in Jenkins configuration
I think this is the best answer for the question. So, in case you have access as admin, you can set it for all pipeline jobs through GUI.
Upvotes: 8
Reputation: 1915
Adding options to the declarative pipeline
pipeline {
agent any
options { timestamps () }
// stages and rest of pipeline.
}
Credit goes to the comment above Jenkins Pipeline: Enable timestamps in build log console
Upvotes: 125
Reputation: 2346
For scripted pipeline just wrap your script in timestamps { }
Eg.
timestamps {
// do your job
}
Note: You must have the timestamper plugin installed: wiki.jenkins.io/display/JENKINS/Timestamper
Upvotes: 62