How to get more logging for persistence service

After my upgrade to OH3 I struggle with my persistence service (influxdb) and I would like to understand the root cause. However, so far I was not able to get enough logging.
So far I have enabled debug logging for the following namespaces:

org.openhab.persistence.influxdb
org.openhab.core.persistence

I was hopping I could see when OH tries to persist an item. But the only log entries I get are:

[e.influxdb.InfluxDBPersistenceService] - Got a query for historic points!

Does anyone have an idea what logging namespace needs to be activated to get more details?

Thanks,
Dominik

Looking to other threads

should be good.

What does

mean ?

While retrieving historic data works fine OH does not seem to persist anything but I also don’t see any error messages.

Without persisting any data OH can’t give you any historic data!

The historic data is still there from the 2.5x installation. OH can connect to influxDB and it also shows me nice graphs (with data up to the migration to OH 3) in the main UI.

How did you setup OH for influxDB persistence? The contents of your influxdb.persist and influxdb.cfg would show that.
I would think you have influxDB persistence installed but not configured to actually persist. Requesting data would work that way.

You might also consider if your Item name or type has changed (many bindings introduce quantity type channels at OH3)

my influxdb.persist looks like this:

Strategies {
}

Items {
	* : strategy = everyUpdate
}

influxdb.cfg:

url=http://influxdb:8086
version=V2

token=xxxxx

# Name of the database for V1 and name of the organization for V2
db=dokabe

# name of the retention policy for V1 and name of the bucket for V2
retentionPolicy=openhab

Shouldn’t that trigger a persistence of every item? If it for whatever reason is not possible I would expect some error messages in the log.

IMHO those settings should work, however they have to be in the correct OH3 folders. If you did an upgrade they might be in openhab2 folders which wouldnot work.

but then also the access to the historic data shouldn’t work …?

Where the database lives is the business of influxdb. Where openHAB persistence configuration files live,is openHAB’s business. There’s no direct link.

1 Like

I agree. I assume that the connection between openhab and influx is working. Otherwise I would not be able to see historic data.
What irritates me is the fact that I don’t see anything in the logs. If there would be a problem with the configuration files or the connection to influx I would expect some error messages.

If the .persist and .cfg files are in a wrong folder OH will not try to persist anything in your influxDB, hence you won’t get any log activity.

In which folders are your .persist and .cfg files?

At least for the .cfg file I would assume I also would not get any historic data if the file would be either invalid or in a wrong location.
The .persist file is in the persistence directory of the openhab config directory. I’m using a docker installation with mounted directories. I.e. there is no risk of pointing to an old OH2 location.

I do see the following logs that the connection to influxdb is established

2021-04-10 10:52:24.221 [DEBUG] [.influxdb.InfluxDBPersistenceService] - InfluxDB persistence service is being activated
2021-04-10 10:52:24.222 [DEBUG] [.influxdb.InfluxDBPersistenceService] - Loaded configuration {url=http://influxdb:8086, component.name=org.openhab.persistence.influxdb.InfluxDBPersistenceService, retentionPolicy=oh_test, service.config.category=persistence, token=7rvE2FEq-rng4exKAX8QWnAh1x8b3yywgGJuBKat6FQkkkjygQ_qDDt-LeNH45AnMn5nSNRK7t9iWeO1B0NLsw==, service.config.description.uri=persistence:influxdb, version=V2, service.pid=[org.openhab.influxdb, org.openhab.influxdb], service.config.factory=false, service.config.label=InfluxDB Persistence Service, component.id=298, db=dokabe}
2021-04-10 10:52:24.233 [DEBUG] [rnal.influx2.InfluxDB2RepositoryImpl] - Succesfully connected to InfluxDB. Instance ready=class Ready {
    status: ready
    started: 2021-04-09T08:51:49.135858087Z
    up: 24h0m35.087421633s
}
2021-04-10 10:52:24.237 [DEBUG] [rnal.influx2.InfluxDB2RepositoryImpl] - database status is OK
2021-04-10 10:52:24.238 [DEBUG] [.influxdb.InfluxDBPersistenceService] - InfluxDB persistence service is now activated
2021-04-10 10:52:43.646 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'influxdb.persist'
2021-04-10 10:52:43.661 [DEBUG] [.influxdb.InfluxDBPersistenceService] - Got a query for historic points!

However, there is still nothing persisted :frowning:

:thinking: out of clues!