Trying to enable DEBUG output

642 views
Skip to first unread message

Richard Smith

unread,
May 11, 2017, 7:36:19 AM5/11/17
to Repo and Gerrit Discussion
I'm trying to diagnose an issue with my gitgub oauth setup where the email address do not show up.   I need some logging help and the ticket suggested I post that here rather than in the ticket


The suggestion in that ticket was to do this:
 
Try to add this line to your gerrit.config file:
[container]
javaOptions = -Dlog4j.configuration=file:///home/gerrit/log4j.properties
 
And then extend the content of log4j.properties with something like this:
log4j.logger.com.googlesource.gerrit.plugins.oauth=DEBUG


I believe I have that working.  I see the option in the command line when I look at the processes with ps and the path to the log4j.properties matches.

I can see the following when I check with logging ls-level

com.googlesource.gerrit.plugins.oauth: DEBUG
com.googlesource.gerrit.plugins.oauth.GitHubOAuthService: DEBUG

But I don't see any new files in the ./logs directory and none of those files have any new debug output.

Where is this debug output supposed to show up?

Richard Smith

unread,
May 11, 2017, 11:57:57 AM5/11/17
to Repo and Gerrit Discussion


On Thursday, May 11, 2017 at 7:36:19 AM UTC-4, Richard Smith wrote:
I'm trying to diagnose an issue with my gitgub oauth setup where the email address do not show up.   I need some logging help and the ticket suggested I post that here rather than in the ticket


The suggestion in that ticket was to do this:
 
Try to add this line to your gerrit.config file:
[container]
javaOptions = -Dlog4j.configuration=file:///home/gerrit/log4j.properties
 
And then extend the content of log4j.properties with something like this:
log4j.logger.com.googlesource.gerrit.plugins.oauth=DEBUG


I believe I have that working.  I see the option in the command line when I look at the processes with ps and the path to the log4j.properties matches.

I can see the following when I check with logging ls-level

com.googlesource.gerrit.plugins.oauth: DEBUG
com.googlesource.gerrit.plugins.oauth.GitHubOAuthService: DEBUG

I figured it out.

The suggestion was to "extend" the log4j.properties  and given that that file does not exist in my tree I just created it with the single entry of 

log4j.logger.com.googlesource.gerrit.plugins.oauth=DEBUG
This breaks all of log4j since all the other parameters are then not set.

The 2nd item is that 'oauth' key does not exist in my version  (2.13.6).

Instead I set GitHubOAuthService to DEBUG with:

ssh <admin> gerrit logging set-level DEBUG com.googlesource.gerrit.plugins.oauth.GitHubOAuthService

 Which generated the debug output in error_log

Also it's handy to know that

./bin/gerrit.sh run

Will run the server with all the output routed to the console.  That was very useful in figuring out that all of log4j was hosed.

luca.mi...@gmail.com

unread,
May 11, 2017, 12:09:52 PM5/11/17
to Richard Smith, Repo and Gerrit Discussion
It gets recorded on the error_logs

Sent from my iPhone
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages