openhab-docs icon indicating copy to clipboard operation
openhab-docs copied to clipboard

Logging level documentation is outdated and factually incorrect

Open jeffsf opened this issue 7 years ago • 4 comments

http://docs.openhab.org/administration/logging.html

Improperly identifies how to change logging levels, where, and the use of the Karaf console.

No, I'm not going to guess as to what it should be as to where and how to set logging levels. Enough of the blind leading the blind already.

jeffsf avatar Apr 01 '17 18:04 jeffsf

Hey @jeffsf, I get that incorrect documentation can be frustrating but please bare with us. What exactly are you complaining about? A command like the following does the job for just fine:

log:set DEBUG org.openhab.binding.zwave

ThomDietrich avatar Apr 03 '17 11:04 ThomDietrich

I think the documentation is quite clear. There is only one thing that is not documented properly. And that is that if you set the log level to DEFAULT that is only kept in the current session. After a restart of the openHAB service the previous log level is set. So setting to DEFAULT does not remove the entry from the configuration file. The only way to achieve this is to manually edit the configuration.

metbril avatar Apr 04 '17 04:04 metbril

http://docs.openhab.org/administration/logging.html#config-file does indicate that log configuration is to be done in org.ops4j.pax.logging.cfg

It does not indicate that changes from the console are not “sticky” across reboots. I have read that it does not somewhere in the Community or docs, but can’t find it at the moment. However, Chris Jackson states that it does persist across restarts. Which is it?

This is crucial, as setting DEBUG level has to be done before the console is available when trying to understand issues with start-up and initial discovery.

Completely in contrast to the above, http://docs.openhab.org/developers/development/logging.html describes an XML-based approach and states that

The configuration file for openHAB is placed in the openhab-distro/lauch/home/logback_debug.xml file.

There is no such file present. I'll ignore the typo, but there isn't a launch/home directory with a packaged install, nor any hints given as the equivalent for such an install.

Yes, it is completely reasonable for someone considering debug logging to be looking at developer docs. They have gotten to the point where user-level documentation has failed, and are trying to understand where the configuration or code is failing.

Describing two completely different ways of accomplishing the same thing, in two different places, without cross references is, at the least, very confusing, potentially misleading, or, at the worst, one of them is completely wrong.

jeffsf avatar Apr 04 '17 18:04 jeffsf

Hey @jeffsf, a short answer (I'm at work):

  • Console vs. file: http://docs.openhab.org/administration/logging.html#defining-what-to-log states:

Note that the log levels set using the log:set commands are not persistent and will be lost upon restart. To configure those in a persistent way, the commands have to be added to the configuration file.

  • "openhab-distro/lauch/home/logback_debug.xml" - This is openHAB 1.x information and needs to be removed. A link to the logging article should be added.

@rtvb DEFAULT is not special in the sense that logging settings via console are volatile.

Conclusion: To me the whole topic seems to boil down to the fact that the documentation should make relation between config file and console clearer: Runtime settings via console, persistent changes via config file. Besides that, the base principle seems reasonable to me, do you agree?

ThomDietrich avatar Apr 05 '17 12:04 ThomDietrich

I have checked the files history, which had many changes since this issue was last updated. The problems described here should be solved and we should move on with #622 and check what is left to do here.

Confectrician avatar Nov 26 '22 10:11 Confectrician