I'd like to write all scripts run in jenkins' script console to the log file so I can monitor what is being run. Currently if I type a simple script in the web console nothing is written out to the /var/log/jenkins/jenkins.log file. I'd also like to see who is executing those commands as well (ie which user). I've tried to change the log configuration, but there isn't any clear information out there that I could use to do this.
Asked
Active
Viewed 3,038 times
1 Answers
0
From UI Manage Jenkins ยป System Log, setting the log level to ALL In /etc/sysconfig/jenkins changing the value of JENKINS_DEBUG_LEVEL also will have the same effect Jenkins operational log
The audit trial plugin also helpful https://wiki.jenkins.io/display/JENKINS/Audit+Trail+Plugin
The below answers gives someways to find out the information about which user triggered the job In Jenkins, how do builds know who requested them?
I personally prefer using -x in shell script and stream the output in some other file , unless I am looking to monitor jenkins itslef .

Subrata Fouzdar
- 724
- 5
- 17
-
I tried changing the log level to ALL in System Log and it didn't seem to change anything. I'm going to test modifying the jenkins script. โ chubbsondubs Jun 28 '17 at 17:59
-
did u omit the trailing . dot in the logger namespace โ Subrata Fouzdar Jun 29 '17 at 12:54
-
Sorry I'm not sure what you're referring to. I just change drop down box to ALL on what I think is the root logger. I didn't provide a name in the field. It updated the UI where it said INFO to ALL as I expected. But I never saw anything in the system logger. I also changed the JENKINS_DEBUG_LEVEL setting from 5 to 9, restarted jenkins, and didn't see any changes in jenkins.log file either. โ chubbsondubs Jun 29 '17 at 15:23