How to enable logging per file/package

27 views
Skip to first unread message

Gerry Storm

unread,
Jan 25, 2019, 3:24:18 PM1/25/19
to Jenkins Users
I built Jenkins from the source and want to enable logging available in some Jenkins source files.

How do I do this?

I tried to follow the instructions in https://wiki.jenkins.io/display/JENKINS/Logging but did not get much mileage.
The page says "Tell us the symptom of your problem in the users list and we should be able to tell you where you need to look at"

How do I enable logging in say core/src/main/java/hudson/model/Queue.java?

Stuart Rowe

unread,
Jan 25, 2019, 4:35:32 PM1/25/19
to Jenkins Users
Hi Gerry,

Create a new named Log Recorder and then configure it following the instructions. Within the configuration page, add a new a Logger for hudson.model.Queue.

You can see where the logger is initialized here: Queue.java#L2792. The loggers are typically identified by class name. 

Hope that helps.

Stuart

Baptiste Mathus

unread,
Jan 28, 2019, 1:22:40 AM1/28/19
to jenkins...@googlegroups.com
I seem to be missing something: why would you build Jenkins just to enable existing logging?

Please clarify what you are trying to achieve. If you mean to enable existing logs, please use the UI and go back here if you have specific questions.
If trying to add *new* logs, then I'd recommend moving this to the Jenkins developers ML as it needs indeed hacking on the code itself.

HTH

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d9969693-cae2-44a9-934a-c29d34c10d94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages