Hi, Have you looked at the Audit Trail Plugin <https://github.com/jenkinsci/audit-trail-plugin/> ? It seems to have an implementation of RunListener <https://github.com/jenkinsci/audit-trail-plugin/blob/master/src/main/java/hudson/plugins/audit_trail/AuditTrailRunListener.java> doing something very close to what you described.
Cheers, Vincent Le lun. 29 mai 2023 à 13:35, Harel H <[email protected]> a écrit : > Hello guys, > > We recently needed a plugin that streams build information to Jenkins > systems logs: > > - Start time > - End time > - Job + build number > - Result > - Initiator > - Agent > > We could accomplish it by adding a function to each Jenkinsfile (calling > java.util.logging.Logger > <https://docs.oracle.com/en/java/javase/11/docs/api/java.logging/java/util/logging/Logger.html?is-external=true#log(java.util.logging.Level,java.lang.String>), > but since it had an overhead, I looked for an alternative. > > I ended up creating a plugin, after not finding a plugin that does it. > Basically all build start / finish events are written to the (main) system > log. > > Example logs: > 2023-05-29 10:42:57.132+0000 [id=78] INFO log_pipeline_plugin#onStarted: > test.pipeline.startup build #90 triggered by hhadad on Built-In Node > 2023-05-29 10:43:04.358+0000 [id=86] INFO log_pipeline_plugin#onCompleted: > test.pipeline.startup build #90 finished with status: SUCCESS > > My Questions: > 1. Do you know of a plugin that does similar things? > 2. If not, will it be a suitable plugin for hosting? > > Thanks, > Harel. > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-dev/3629c3ba-2a1d-4574-b4ee-b31601209e3an%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-dev/3629c3ba-2a1d-4574-b4ee-b31601209e3an%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAH-zGCg1SAj0goohw98u1Ea4N-rrXsC6YaD5H_Fb%3D7DzmUWTUQ%40mail.gmail.com.
