Jenkins.log location on Ubuntu 14.04 desktop

拥有回忆 提交于 2019-12-04 06:37:41
  • Am I correct in my understanding that Jenkins system logs are output to the jenkins.log file?
    • Yes you are rigth. Internal engines, plugins, etc saves its logs in jenkins log file
  • Where might the jenkins.log file be located on my machine?
    • What is your command line which is executed as service in your machine?
  • Is this the best approach in troubleshooting issues with Jenkins when the web UI is inaccessible?

Steps to find your jenkins log path

  • locate jenkins service file :

    /etc/default/jenkins: location for most of the Linux distributions.

    /etc/sysconfig/jenkins: location for RedHat/CentOS distribution.

  • Open it and probably you will see :

    NAME=jenkins

    JENKINS_LOG=/var/log/$NAME/$NAME.log

    So your file /var/log/jenkins/jenkins.log must be exist. If not like you said, try to add this line

Jenkins does not write to any file, so there is no jenkins.log by default, instead it writes to the standard output.

So here is something we used in the init.d file:

JENKINS_WAR=/path/to/jenkins/war/jenkins.war
JENKINS_LOG=/path/to/jenkins/log/jenkins.log
JAVA_HOME=/path/to/java/home

STARTUP="$JAVA_HOME/bin/java -Xms4096m -Xmx8192m -Dhudson.model.DirectoryBrowserSupport.CSP= -jar $JENKINS_WAR > $JENKINS_LOG 2>&1 &"

Also as suggested in the doc, you can use hook script to make it rotated.

You might also be interested in Audit Trail Plugin.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!