Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 257
Triangle Avatar asked Sep 14 '15 09:09

Triangle


People also ask

How do I monitor Jenkins logs?

If you want to want to monitor all the Jenkins instances, then you need to install filebeat in all the instances and ships the application log to logstash. Here, we will ship the application logs of one Jenkins instance only. Below is the filebeat. yml to monitor jenkins log file.

Does Jenkins have an audit log?

Overview. This plugin provides audit logging for various Jenkins events. These include build lifecycles, node lifecycles, login/logout, item lifecycles, and some other events. These audit events use Apache Log4j Audit to define standardized event interfaces and logging through Apache Log4j2 plugins.

Where are Jenkins logs stored?

This plugin will write custom log recorders into $JENKINS_HOME/logs/custom/ on the Jenkins controller's filesystem. You can then tail the relevant file to see updates to it. (Jenkins 2.114 introduced a system property which allows you to specify a different location to store Jenkins logs.

How do I view Jenkins logs in Windows?

Now open a new tab in your web browser and type the URL http://192.168.33.10/logs/jenkins. You will see all the content of the Jenkins server /var/log/jenkins folder, including the jenkins.


2 Answers

  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

like image 153
anirudh parmar Avatar answered Sep 27 '22 17:09

anirudh parmar


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?

like image 25
Bruno Lavit Avatar answered Sep 27 '22 17:09

Bruno Lavit