How do I see the full name of a logger?

I want to set the logging level for persistance to debug, but what is the correct logger name?

I set all to debug, so what I see is:

20:43:15.009 [DEBUG] [sistence.rrd4j.internal.RRD4jService] - Stored 'ZWave_Fire_Ian_Temperature' with state '23.1' in rrd4j database

What is the full name of the logger? Can I disable the truncating somewhere or is there some overview of the logger hierarchie?

Sorry, but this does not answer how to find the actual names of the loggers?

As with all logging libraries, the hierarchy fit individual loggers follows the class hierarchy.

Persistence didn’t have its own logger and instead inherits from the main logger which writes to openHAB.log, I’m not at a computer so can’t look to see which one.

If you find the class name or the package level you want to adjust logging for just follow the example in that posting using the persistence classes instead of zwave.

I’m fully aware how log4j works - I just need to know what comes before the truncated sistence.rrd4j.internal.RRD4jService in the karaf console?

Ist it org.eclipse.smarthome.persistence? Seems not, because setting the loglevel for this logger has no effect.

I’ve been wondering that myself, at the moment I’ve been trolling through the system directory (e.g. (/usr/share/openhab2/runtime/karaf/system) or (\runtime\karaf\system\) to find these names.

This suggests to me that the long names for persistance are org.eclipse.smarthome.core.persistence for standard persistance, and org.openhab.persistence.rrd4j for openhab specific (which you are probably looking for).

That would make sense. Core stuff is in the ESH packages but OH add-ons will be in the org.openhab packages.

Actually this doesn’t really answer the question right. There’s still not solution or log4j setting we could apply to disable truncating logger class names. Any recipe on what to put what in which config would be very helpful

1 Like

There is still a very urgent need for something like a log hierarchy browser. Is there a way to use standard tools?

Tracking down problems with openhab is a nightmare, because you never know where to look :frowning:

The documentation only tells you how to set log levels but not where to find problems.

Only experience will tell you where to find problems.

Not sure what you’re referring to by the term “log hierarchy browser”.

With a hierarchy browser I meant a tool that shows all used loggers and let you set a specific log level for each logger or higher hierarchy levels (e.g. “smarthome.event” or “org.openhab”).

There isn’t even a static documentation available for existing loglevels.

And the logging hierarchy is not consistent. Some are based on package name following the Java package name rules (e.g. org.openhab), other omit the high level names (e.g. smarthome instead of org.eclipse.smarthome).

So to get the experience to know the logger hierarchy, you need to be a developer for openhab core or bindings, not just a user that wants to develop own rules.

You can use openHAB’s console and the command log:list to look at the currently set logging levels:

Does this help at all? I agree there should be some sort of list defined somewhere for specifics, but this list might be huge.

Which is why having a list of everything is pointless. Perhaps the readme for each binding/service should have a list of its own packages as a reference.

1 Like

AFAIK, this is not true. All of the logging uses the full package name.

ESH uses “smarthome” as highest level, not “org.eclipse.smarthome”.

Has anyone come up with an easy way to find these logger names?

Yes, use the console and use the pattern parameter:

openhab> log:display -p "\%d{ISO8601} | \%-5p | \%-75c | \%-20X{bundle.version} | \%m\%n"
2018-10-02 12:19:32,168 | INFO  | org.eclipse.smarthome.core.internal.i18n.I18nProviderImpl                   | 0.10.0.201809210646  | Time zone set to 'Europe/London'.
2018-10-02 12:19:32,205 | INFO  | org.eclipse.smarthome.core.internal.i18n.I18nProviderImpl                   | 0.10.0.201809210646  | Location set to '[redacted]'.
2018-10-02 12:19:32,212 | INFO  | org.eclipse.smarthome.core.internal.i18n.I18nProviderImpl                   | 0.10.0.201809210646  | Locale set to 'en_GB'.
2018-10-02 12:19:32,216 | INFO  | org.eclipse.smarthome.core.internal.i18n.I18nProviderImpl                   | 0.10.0.201809210646  | Measurement system set to 'SIUnits'.
2018-10-02 12:19:32,789 | INFO  | org.openhab.ui.dashboard.internal.DashboardService                          | 2.4.0.201809261735   | Started Dashboard at http://192.168.0.2:8080
2018-10-02 12:19:32,796 | INFO  | org.openhab.ui.dashboard.internal.DashboardService                          | 2.4.0.201809261735   | Started Dashboard at https://192.168.0.2:8443
2018-10-02 12:19:52,449 | INFO  | org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl               | 0.10.0.201809210646  | Loading model 'mapdb.persist'
2018-10-02 12:20:00,718 | INFO  | org.eclipse.smarthome.model.lsp.internal.ModelServer                        | 0.10.0.201809210646  | Started Language Server Protocol (LSP) service on port 5007
2018-10-02 12:20:07,638 | INFO  | org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl               | 0.10.0.201809210646  | Loading model 'home.rules'
2018-10-02 12:20:08,675 | INFO  | org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl               | 0.10.0.201809210646  | Loading model 'bedroom.rules'
2018-10-02 12:20:11,138 | INFO  | org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl               | 0.10.0.201809210646  | Loading model 'hallway.rules'
2018-10-02 12:20:12,540 | INFO  | org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl               | 0.10.0.201809210646  | Loading model 'livingroom.rules'
2018-10-02 12:20:13,242 | INFO  | org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl               | 0.10.0.201809210646  | Loading model 'kitchen.rules'
2018-10-02 12:20:14,474 | INFO  | org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl               | 0.10.0.201809210646  | Loading model 'default.sitemap'
2018-10-02 12:20:17,005 | INFO  | org.openhab.binding.zwave.handler.ZWaveSerialHandler                        | 2.4.0.201809261735   | Connecting to serial port '/dev/ttyACM0'
2018-10-02 12:20:17,081 | INFO  | org.openhab.binding.zwave.handler.ZWaveSerialHandler                        | 2.4.0.201809261735   | Serial port is initialized
2018-10-02 12:20:17,130 | INFO  | org.openhab.binding.zwave.internal.protocol.ZWaveController                 | 2.4.0.201809261735   | Starting ZWave controller
2018-10-02 12:20:17,132 | INFO  | org.openhab.binding.zwave.internal.protocol.ZWaveController                 | 2.4.0.201809261735   | ZWave timeout is set to 5000ms. Soft reset is false.
2018-10-02 12:20:17,156 | WARN  | org.openhab.binding.zwave.internal.protocol.ZWaveTransactionManager         | 2.4.0.201809261735   | NODE 6: Not initialized (ie node unknown), ignoring message.
2018-10-02 12:20:17,164 | WARN  | org.openhab.binding.zwave.internal.protocol.ZWaveTransactionManager         | 2.4.0.201809261735   | NODE 6: Not initialized (ie node unknown), ignoring message.
2018-10-02 12:20:19,350 | WARN  | org.openhab.binding.zwave.internal.protocol.ZWaveTransactionManager         | 2.4.0.201809261735   | NODE 6: Not initialized (ie node unknown), ignoring message.
2018-10-02 12:20:21,561 | INFO  | org.eclipse.smarthome.ui.basic.internal.servlet.WebAppServlet               | 0.10.0.201809210646  | Started Basic UI at /basicui/app
2018-10-02 12:20:21,951 | INFO  | org.eclipse.smarthome.ui.paper.internal.PaperUIApp                          | 0.10.0.201809210646  | Started Paper UI at /paperui
2018-10-02 12:20:24,632 | INFO  | org.openhab.ui.habmin.internal.servlet.HABminApp                            | 2.4.0.201809261735   | Started HABmin servlet at /habmin

The “%-75c” shows the class up to 75 characters. Simply use “%-c” if you have classes that are longer.

2 Likes

Thanks Ben - just managed to figure it out.
Glad you posted though, will save me next time I forget :grinning:

1 Like