Version 4.2.3 in docker and problem stopping logging to logfiles openhab.log/events.log

Hi all,
since last weekend i updated to openhab on docker Version 4.2.3 from before 4.2.2 (which im updating from older versions since a longer time. From Release logs i got out that this should be only a version which should not change something and only have fixings only.

Im using a volume for /openhab/userdata to have this path outside the container.

Because i searched for another problem with a javascript-rule i had a look to the logfiles. Situation inside container is now this:

ls -la *.log
-rw-r--r-- 1 openhab openhab        0 Jul 19 21:06 audit.log
-rw-r--r-- 1 openhab openhab 12393813 Nov 27 00:59 events.log
-rw-r--r-- 1 openhab openhab 14594540 Nov 27 01:00 openhab.log
-rw-r--r-- 1 openhab openhab     1176 Nov 29 10:43 update.log

The update.log ends with SUCCESS: openHAB updated from 4.2.2 to 4.2.3
There is also timestamp from Update visible from line: “You can find backup of userdata in /openhab/userdata/backup/userdata-2024-11-29T10-42-29.tar”
Both logfiles openhab.log and events.log were no more filled with content. Last timestamp from last logline in openhab.log is 2024-11-27 01:00:00.514, which seems not the timestamp when i did the update. So from my opinion my problem can not have a relation to the update

I did some restarts of the container but it seems no more to log into the files. But openhab seems to work fine. But for debugging javascripts i would like to get it logging again.

My Question is something known which makes openhab to stop logging? Or how can i make it start logging again?
The disk has space enough to log.
Thank you for giving me a hint.

Not that I’m aware of. All logging is currently working for me and I’m running in Docker too.

It might be that your userdata/etc/log4j2.xml file got corrupted or lost during the update or prior to that.

Does that file look reasonable?

The “official” unmodified one can be found inside the container at /openhab/dist/userdata/etc/log4j2.xml.

You can compare your version with this version with the command

docker exec -it openhab diff userdata/etc/log4j2.xml dist/userdata/etc/log4j2.xml

You can just copy over the default config with the command

docker exec -it openhab cop dist/userdata/etc/log4j2.xml userdata/etc/log4j2.xml

Usually, if OH is working but nothing is being logged, it means there is something wrong with the log4j2.xml file. If there isn’t enough disk space or OH cannot write to the log files for some reason OH will refuse to come up.

Hi Rich,
a lot of things were different and so i decided to do

docker exec -it openhab cp dist/userdata/etc/log4j2.xml userdata/etc/log4j2.xml

i copied it over and after that did a restart over 4.2.3 but it did not log.
So i tried to go back to 4.2.2 and then the only logfile which was written then was update.log which told me the success of downgrade.

So what i now surely know is that the version is not the problem and also not log4j2.xml.

But i have no idea what else it could impact or what i can try.

Update: i moved openhab.log and events.log away, restarted openhab. Then only openhab.log was recreated but stays 0 Bytes. events.log not recreated.

update.log is written to by the entrypoint script, not openHAB itself. You’ll see stuff in there any time you start the container with a version of OH that differs from tghe version in the mounted volume (it looks at userdata/etc/version.properties to be specific).

You can run docker logs -f openhab and see if it’s outputting an error when it starts. Beyond that I can’t think of any reasons why it woudln’t log.

.....
+ exec gosu openhab tini -s ./start.sh server
Launching the openHAB runtime...
09:35:05.067 [OH-ruleengine-1] ERROR org.openhab.core.automation.internal.RuleEngineImpl
..... here more logs from rules which former were in openhab.log

unfortunatly nothing in logs gives me a hint. But former the logs were all in openhab.log written and after “Launching the openHAB runtime…” normally the docker log no more filled after launch of startscript. Now there are the rule-logs.
But the events.log stays empty as the openhab.log.
I also got an log4j2.xml from backup middle november but no difference.

ok, i tried from documentation (Logging | openHAB) to login to karaf-konsole and see the itemlogs from there. and there i got the following:

openhab> log:tail org.openhab.io.rest.core.item.ItemResource                                                                                                                                                                                                                                                                                                                                                                               
Error executing command: Unrecognized configuration

this seems to be a hint, but what configuration is it?

now i got an older article [SOLVED] OH3 logging not possible, openhab.log last entries some days ago - #10 by jimtng

ls -la org.ops4j.pax.logging.cfg
-rw-r--r-- 1 9001 9001 0 27. Nov 01:00 org.ops4j.pax.logging.cfg

This file was corrupted.

I entered the contend ssuggested by the article “org.ops4j.pax.logging.log4j2.config.file=${karaf.etc}/log4j2.xml” and now it loggs again.

Thank you for all.