Output to logfile fails when upgrading from 2.319.3 to 2.346.2

Hello
We use Jenkins on Linux on a regular basis.

I attempted to upgrade from 2.319.3 to 2.346.2 as a response to the vulnerability, as the title suggests.
As a result, although Jenkins itself can be accessed normally and the operation itself is not a problem, the logs that were output to the log file (/var/log/jenkins) are now standard output.

I was still using Jenkins with System V init, so I checked the following page to make sure the “override.conf” was created by the migration

After that, I added Environment to “override.conf” so that the output would be written to the log file as before, referring to the following page
「Environment=“JENKINS_LOG=/var/log/jenkins/jenkins.log”」

However, the output is still the same as the standard output.

How can we make it possible to output to the log file as before with System V init?
Thank you in advance.

Hello @KyoheiYano and welcome to this community :wave:

Are you sure about the syntax you use for override.conf?
In the documentation I can see a different syntax (that worked for me):

To customize the log location, run systemctl edit jenkins and add the following:

[Service]
Environment="JENKINS_LOG=%L/jenkins/jenkins.log"
1 Like

Hello @poddingue
Thanks for the reply.

Are you sure about the syntax you use for override.conf ?

I have also tried the syntax as described in the documentation.
But the result was the same

I understand that %L is a specifier that can be used in Systemd.Unit.
Therefore, if you are using System V init, you have specified the full path

1 Like

You could also tell systemd to redirect stdout to a new file

That may work. I’ve not worked with the systemd aspect of jenkins yet

1 Like

Thank you. @halkeye

You could also tell systemd to redirect stdout to a new file

I tried the following settings in override.conf, but unfortunately the result did not change

[Service]
StandardOutput=file:/var/log/logfile

I have a feeling that the systemd configuration is not valid because I am using System V init
In the following file, changing JENKINS_HOME had no effect on Jenkins.

/etc/systemd/system/jenkins.service.d/override.conf
/usr/lib/systemd/system/jenkins.service

you can’t be using sysv and systemd

if you are using a package manager (debian or redhat, etc), then the packages have fully switched to systemd.
If you’ve installed things yourself and then running things yourself (java -jar jenins.war), then you can configure things yourself.
If your using package manager, but upgrading your .war file manually, things will not work right.

1 Like

Package manager is used, but still using Amazon Linux as OS, systemctl and other systemd operations cannot be used
(we recognize that the best thing to do is to upgrade the OS.)

In this case, if I upgrade Jenkins, will all logs be standard output?