I’m currently setting up openHAB 2. In order to find the cause for my problems, I tried to turn on DEBUG logging.
I know about the log:set command, but it doesn’t seem to have effects directly.
For example to get TRACEs of all milight communication I set this:
log:set TRACE org.openhab.binding.milight2
But nothing changes in the logs although I’m communicating to my milight bulbs. Is there any commit necessary in order for the setting to get active?
The second question is about the logging pattern. For some for me not understandable reason it’s common use to setup the logging in a way that the fully qualified package name is trimmed after n characters. This way it’s not possible for me to set some “spamming” packages - e.g. jetty - to a higher log level than the others because I don’t know the complete package name.
Is there a way to set a custom logging pattern?
With a little bit of research into log4j you can configure the logs hire ever you want.
When you issue commands like log:set in the console, it only affects the logs that you can tail from within the console and do not affect those written to file.
Take heed of the warning. Right now the log config gets replaced on an upgrade so keep a copy of your changes before updating until that gets fixed.
Sorry - I’m not completely successful After setting DEBUG to the root logger I see Debug Messages in openhab.log, but still not from the milight binding. According to the milight binding’s code a debug message is logged on every command it sends.
Could there be some special things to do - e.g. related to OSGI?
@peez increasing the log level for a binding can be done by log:set and checked with log:list in the karaf console. This setting will be lost after a restart of openHAB. Could you try another binding to rule out a general problem and maybe pin it on milight…?
I think, if I remember correctly, if you replace the %-36.36c with %C it will print out the fully qualified classname un-truncated. Beware, the apache docs indicate this is expensive and could slow you down, so change it back once you are done debugging you problem.
Is it possible to turn off logging (in org.ops4j.pax.logging.cfg) for specific bindings, like, the HTTP 1.x Binding, or the EXEC Binding?
When the device is offline, it should not print an error.