简体   繁体   中英

How to enable debug logging on jenkins?

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.

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

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

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'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM