docker
docker copied to clipboard
NOT able to enable Jenkins access logs
NOT able to set/enable Jenkins access logs inside the container
I am trying to enable Jenkins Access Logs inside the container. I followed the general link which describes access logging https://wiki.jenkins.io/display/JENKINS/Access+Logging. Tried to put JENKINS_ACCESSLOG under ENV in our automation scripts but it did not work
After digging for a sometime, found out that jenkins.sh (which resides in /usr/local/bin/ i.e. path inside container) is the main script which reads the arguments and executes. I tried to set/enable the access log in this shell script and it worked. But this is very tedious way to achieve objective
Jenkins version: 2.164.2 Docker version: 18.09.2
- Is it possible to set/enable Jenkins user access logs from Jenkins home directory inside docker container?(/var/jenkins_home is the Jenkins home inside container). If yes, May I know how to set/enable access logs in this case
- Also access logs does not contain user names. Is it possible to print the same in access logs Can anybody help on this front?
Thanks, Nikhil
can anybody update on this issue please
Ok. solved!! We can use JENKINS_OPTS under ENV section (in ansible role). I was using JENKINS_ARGS instead of JENKINS_OPTS
now new line which solved the problem is : -
JENKINS_OPTS: "--accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/jenkins_home/logs/access_log"
Is it possible to log the username in Jenkins AccessLogs ?
Hello. i use:
/usr/bin/docker run --name jenkins-master
--group-add=233
--publish=8081:8080
--publish=50000:50000
--env JAVA_OPTS=-Xmx2g
--env JENKINS_ARGS="--httpKeepAliveTimeout=30000 --httpsKeepAliveTimeout=30000 --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=comb
ined --simpleAccessLogger.file=/var/jenkins_home/logs/access_log"
--user root
jenkins/jenkins
but access log not write. Help me pls.
Can you try with JENKINS_OPTS (as an environment parameter)instead of JENKINS_ARGS
https://github.com/jenkinsci/docker/pull/1292 Could you check it this pr fixes your issue? :)
Hi, Iwould like to work