0

I just wanna disable Jenkins to log anything. When I set log level in GUI ($JENKINS_URL/log/levels), it will be reset on default setting after a Jenkins restart.

So I want to turn off all logs permanently, probably I should modify JAVA_ARGS, but what I should modify there?

K. B.
  • 1,356
  • 2
  • 14
  • 20
Mosa
  • 31
  • 1
  • 3

3 Answers3

0

You need to do safe restart only. If you do killing the process or some other non safe, It will not save its configuration data. So in your case, please do Safe Restart like (jenkins_url)/safeRestart to hold on to jobs after restart and restart will be after completion of existing jobs. (jenkins_url)/restart for normal safe restart without job data of queue. Hope this helps.

SV Madhava Reddy
  • 1,530
  • 2
  • 11
  • 28
0

Groovy script can be used to plug in upon Jenkins initialization. Please make file with name init.groovy in your Jenkins home folder with changed logger names according to your needs. Here is a sample file content:

import java.util.logging.Level
import java.util.logging.Logger

Logger.getLogger("").setLevel(Level.OFF)
Logger.getLogger("org.apache.sshd").setLevel(Level.OFF)
Logger.getLogger("winstone").setLevel(Level.OFF) 

I have tested this approach on Ubuntu and Windows and it kept permanently the log level changes. I believe it will work for other OS also. More info in my article on this topic here.

K. B.
  • 1,356
  • 2
  • 14
  • 20
0

After trying bunch of solutions, I still had that file growing to multiple gigs (especially after a jenkins restart/update) and clogging my server.

I came up with this solution - pretty radical : since the user that created this file is jenkins, I deleted and re-created the file as root, so basically jenkins can't write anymore into it. Problem fixed.

HRK44
  • 1,642
  • 1
  • 8
  • 25