jenkinsci / audit-log-plugin

Audit logging plugin for Jenkins based on Apache Log4j Audit
https://plugins.jenkins.io/audit-log/
MIT License
20 stars 22 forks source link

[JENKINS-56645] Log audit event for build finish #22

Closed gayathrirajendar closed 5 years ago

gayathrirajendar commented 5 years ago

Audit event for the start of the build was already present in the plugin. I am modifying it to add an event for the finish of the build too.

Steps:

See JENKINS-56645

Requesting review with @jvz

jvz commented 5 years ago

An investigative task related to the time formatting: depending on how people set up Jenkins, agents might not have the same timezone configured as the master node. In that case, we'll want to make sure that timestamps used in audit events are all UTC or include timezone info so we can use ZonedDateTime or OffsetDateTime instead of Instant or LocalDateTime.

gayathrirajendar commented 5 years ago

Sure. Like it is planned in the other PR #23 , we can use ZonedDateTime by fetching the zone from the system default value and have them formatted in the ISO - 8601 format. This has to be changed once that is accepted.

Does this answer the investigation?

jvz commented 5 years ago

That sounds like it would work. I'm not sure if any of the audit events we create are ever created on an agent instead of master, so the investigation might be to determine that. If we only ever create audit events using the master node, then we can likely just convert the local time to UTC.

jvz commented 5 years ago

Thanks for the contribution! You can follow up in the other PR for date-related improvements as you suggested.