How to enable debug logging on jenkins?
Asked Answered
I

3

14

I am trying to debug how the ssh-slaves is behaving but the Jenkins documentation from https://wiki.jenkins-ci.org/display/JENKINS/Logging is extremely incomplete.

I added a new logger and added:

  • "hudson." with ALL
  • "org.jenkinsci.plugins." with ALL

Still the new log added is not updated at all.

Also, I found no information on how to enable logging for everything, empty, start or what?

Update: I tried to add -Djava.util.logging.loglevel=FINE to the command line starting Jenkins but to my surprise it did not had any effect on the JENKINS_LOG but it did had an effect on the log you can check on the GUI.

Ieyasu answered 11/7, 2013 at 9:36 Comment(2)
Are you using 1.519 or up? There were a few issues related to logging resolved in 1.516 and 1.519.Springs
any luck with that? I just arrived at the same crossroads. On the slave side there are no connect attempts logged in in auth.log. On the Jenkins master side I so far could not activate the logging. I tried a Logger for "hudson.plugins.ec2" with loglevel "FINE".Caulescent
A
4

I know this is a bit late and doesn't resolve your root prolem, but I found I could enable logging by not adding a '.' (dot) at the end of the logger name. So, add

  • 'hudson' with ALL
  • 'org.jenkinsci.plugins' with ALL
Aboulia answered 12/2, 2016 at 13:53 Comment(0)
B
3

Typically, you would use the GUI for viewing the logs, which is why it had that effect; however, if you want something the GUI doesn't provide (such as better information of what is going on with a slave), you may have to look to the container you're running Jenkins in, review the logging config, set it to debug, and read the logs there, or try running the slave manually from the node...

If on the node, you can try running the slave with something like: java -jar slave.jar -jnlpUrl http://<yourJenkinsUrl>:8080/<computer>/<slave>/slave-agent.jnlp to get better details about that specific slave's interaction with the master server.

This is definitely a known issue. It appears to be resolved in later builds: https://issues.jenkins-ci.org/browse/JENKINS-19453

Bunghole answered 29/1, 2014 at 18:28 Comment(1)
"Typically, you would use the GUI for viewing the logs" - particularly problematic when one wants to debug an authorisation problem!Scenery
M
2

As Ritesh has said, there shouldn't be a trailing '.' on the logger namespace.

Also, I suggest including the 'jenkins' namespace:

"hudson", "jenkins", and "org.jenkins.sci"

Setting these three to "all" will generate a ridiculous amount of logs, which can be used to identify the specific namespaces you are most interested in.

Create new loggers for those, and set the top-level namespaces to 'none', 'error', or 'warning'.

Morphology answered 2/5, 2016 at 18:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.