Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins.log location on Ubuntu 14.04 desktop

Setup

I am currently running a Jenkins instance on an Ubuntu 14.04 desktop machine. I have installed Jenkins via WAR distribution and am running Jenkins as a service on the host machine.

Issue

I am trying to access the jenkins.log file described here in the logging documentation on the Jenkins wiki. The purpose of accessing this file is to be sure we have a log to use in the event that Jenkins web UI is unavailable and there is an issue with Jenkins.

I've taken a look in /var/log/jenkins/ as the documentation suggests, however the only file in that folder is a config file.

Also, per the documentation, I have double checked the /etc/default/jenkins as well as the /etc/sysconfig/jenkins directories. Each one of these two directories does not exist on my machine.

I have also tried searching from command line using the 'find' command, as well as searching my system using the Ubuntu file explorer. Each of these approaches yielded no jenkins.log file.

Questions

  • Am I correct in my understanding that Jenkins system logs are output to the jenkins.log file?
  • Where might the jenkins.log file be located on my machine?
  • Is this the best approach in troubleshooting issues with Jenkins when the web UI is inaccessible?
like image 528
J0991 Avatar asked Jul 07 '17 19:07

J0991


People also ask

Where is Jenkins log file in Linux?

Log files should be at /var/log/jenkins/jenkins.

Where is Jenkins config file Ubuntu?

Note: The default location for the Jenkins configuration file on Ubuntu and Debian is /etc/default/jenkins. If you are working with RedHat, CentOS, or Fedora, the Jenkins configuration file is located at /etc/sysconfig/jenkins.

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.

How do I clear Jenkins logs?

Go to your Jenkins home page -> Manage Jenkins -> Script Console. Run this script to clean and reset. Copy and paste this script to your Console Script text area and change the "copy_folder" to the project name that you need to clean the history. Then click the Run button.


1 Answers

  • 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?
    • Yes you have the jenkins log file or a web alternative : https://your.jenkins.com/log/all but jenkins.log has more information

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

like image 73
JRichardsz Avatar answered Sep 28 '22 12:09

JRichardsz