Triangle
Triangle

Reputation: 1507

How do I monitor log of the users who successfully logged into my Jenkins Server?

I want to Monitor name/E-mail/IP id of User's who Successfully logged in to my Jenkins's server. I am the system Administrator. Please help.

Upvotes: 11

Views: 28567

Answers (4)

anirudh parmar
anirudh parmar

Reputation: 231

  1. Go to -> Manage Jenkins -> System Log
  2. Click on add new log recorder and name it anything you like for example -> user_access_details
  3. Then click on add loggers once prompted and add jenkins.security.SecurityListener and set it to Finest level

Should look like this -

Should look like this

Logs would look like this -

Logs would look like this

Upvotes: 23

Bharath Nadar
Bharath Nadar

Reputation: 11

Using Audit trail you can achieve this by adding the following parameter (login|logout|loginError). One issue with this approach is it will give the logout and loginError properly but login info is not satisfactory .

Upvotes: 1

grayaii
grayaii

Reputation: 2444

If you want to see who is doing what, I would install the Audit Trail Plugin: https://wiki.jenkins-ci.org/display/JENKINS/Audit+Trail+Plugin and if you're really hardcore, I would install the Audit to Database Plugin: https://wiki.jenkins-ci.org/display/JENKINS/Audit+To+Database+Plugin

Upvotes: 2

Bruno Lavit
Bruno Lavit

Reputation: 10382

You can enable access log by adding these lines to /etc/default/jenkins above JENKINS_ARGS:

# Enable access log
JENKINS_ACCESSLOG="--accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/log/jenkins/access.log"

Enable log rotation: edit /etc/logrotate.d/jenkins and change /var/log/jenkins/jenkins.log to /var/log/jenkins/*.log

Copy from here.

Does it help?

Upvotes: 1

Related Questions