Added RequestContext.setUserId() to UserLogListener class methods in order to have the username detail logged as part of audit-event log message(s).
Commented out the RequestContext.setIpAddress() method-call that was used within the loggedIn() method of the UserLogListener class. During the implementation of unit-tests for this class it was observed that the inner method call to Stapler.getCurrentRequest().getRemoteAddr() throws a NullPointerException, which returns null to any external calling methods.
Would need to investigate further as to why the Stapler method behaves this way and perhaps look for workarounds.
(NB: the aforementioned unit-tests for the class are in a separate pull-request)
Related to JENKINS-54965.
RequestContext.setUserId()
to UserLogListener class methods in order to have the username detail logged as part of audit-event log message(s).RequestContext.setIpAddress()
method-call that was used within theloggedIn()
method of the UserLogListener class. During the implementation of unit-tests for this class it was observed that the inner method call toStapler.getCurrentRequest().getRemoteAddr()
throws aNullPointerException
, which returnsnull
to any external calling methods.Desired Reviewers: @jvz @jeffret-b