opengrok icon indicating copy to clipboard operation
opengrok copied to clipboard

default and comments of logging.ConsoleHandler.level

Open Shooter3k opened this issue 6 years ago • 6 comments

Can someone please check and validate these lines of code as setting the value to "quiet" is not a valid option and returns back:

Bad level value for property: java.util.logging.ConsoleHandler.level
Can't set level for java.util.logging.ConsoleHandler

It doesn't make sense to mention "quiet" or "verbose" because neither of those are options listed on line 30 of this file: https://github.com/oracle/opengrok/blob/master/logging.properties

# Limit the message that are printed on the console to WARNING and above (default "quiet" mode).
# if verbose is set, then log INFO and above
java.util.logging.ConsoleHandler.level = WARNING
java.util.logging.ConsoleHandler.formatter = org.opengrok.indexer.logger.formatter.SimpleConsoleFormatter

Shooter3k avatar Dec 12 '18 21:12 Shooter3k

What is meant in the comment is that setting the level to WARNING will make the logging somewhat quiet (as opposed to the lower log levels). The comment should be expanded in this sense.

vladak avatar Dec 12 '18 21:12 vladak

Actually, the verbose probably means the Indexer flag that got changed in cset 83adc92c

vladak avatar Dec 12 '18 21:12 vladak

On a related note, I found this issue (and #137) while looking for INFO output to console when indexing with -v.

Are we sure after [83adc92] that the -v argument still changes the log level to include INFO to the console? I have made some changes in PerforceRepository, and when the log() line I added uses WARNING, I see it. But, when I set it to INFO, I do not see it even when running with -v.

(I do, however, see Logging filehandler pattern: opengrok%g.%u.log in the console output, which I don't see when I don't add -v to the command line.)

Should I open a new issue for this, or am I missing something?

cross avatar Apr 26 '19 13:04 cross

Hmm. I think I figured this out. It turns out that I'm invoking my index with a wrapper script for command line tools. It is running the opengrok.jar with -Djava.util.logging.config.file=/opt/opengrok/doc/logging.properties, and it appears that config isn't overridden by the -v command-line arg. Not sure what the right thing is, but I can work past the issue I had now.

cross avatar Apr 29 '19 14:04 cross

I think the -v option should just go away. I preserved it for compatibility with older versions originally. There should be just one way how to set logging levels.

vladak avatar Apr 29 '19 21:04 vladak

Can I have a go at this? Looking to make my first open-source contribution.

ethanotran avatar Sep 13 '22 17:09 ethanotran