Hi team, I installed Jenkins and restored from ssd disk but I am unable tosee lo . . .

Ravi Kumar:
Hi team,
I installed Jenkins and restored from ssd disk but I am unable tosee logs in "/var/log/jenkins “, there is no file with " jenkins.log…”…
Please help me

Al West:
What operating system are you using? Look at the jenkins config file in /etc/default/ for Debian/Ubuntu or /etc/sysconfig/ for Red Hat/Fedora/CentOS.

Ravi Kumar:
Debian, /etc/default/

Ravi Kumar:
It’s showing /var/log/jenkins but there is no Jenkins. Log, in that location

Ravi Kumar:
I mean - /etc/default - Jenkins config points logs to - /var/log/jenkins but I that location there is no jenkins.log…

Al West:
how have you installed Jenkins?

Al West:
I’ll assume you installed in on the host. This is what I did on Ubuntu 20.04LTS which should be the same as Debian for this purpose.

Edit the service:

sudo vi /etc/systemd/system/multi-user.target.wants/jenkins.service

And uncomment this line (remove the #):

#Environment="JENKINS_LOG=%L/jenkins/jenkins.log"

Then reload systemd:

sudo systemctl daemon-reload

Then restart Jenkins:

sudo service jenkins restart

Then you can view the logs:

tail -F /var/log/jenkins/jenkins.log

I am surprised this is not documented as much on the web.

Ravi Kumar:
Still, not showing jenkins.log in /var/log/jenkins.log

Ravi Kumar:
Shall I uncomment, in /etc/default/jenkins too, that
“Environment =” JENKINS_LOG=%L/jenkins/jenkins.log

Al West:
Yes uncomment that line. My instructions should work, are you sure you did them all?

Al West:
You have to carry out some activity in Jenkins for something to be written to the logs like installing a plugin.

Ravi Kumar:
Yes, I did all,
Now I have to uncomment that in /etc/default/jenkins…
Then again shall I again run this> sudo service jenkins restart

Ravi Kumar:
Thank you, you are my savior…