Dietmar75
(Dietmar)
December 11, 2023, 6:50pm
1
Hi, need help,
My OH stops to log at all, no openhab log, no event log.
My last change was to change the log configuration for the MOD-Bus Binding, back from “trace” mode. Now, for all bindings I have a empty config page for this kind of log-configuration .
What I have tried:
deleted all old log files
checked the log config files according to some forum posts.
Thanks a lot
Dietmar
rlkoshak
(Rich Koshak)
December 11, 2023, 7:03pm
2
It sounds like when you checked you missed something, an error of some sort. There are also two files.
org.ops4j.pax.logging.cfg which has a single line:
org.ops4j.pax.logging.log4j2.config.file=${karaf.etc}/log4j2.xml
The other is log4j2.xml. As an XML file it’s easy to render it unparsable with a stray character or removal of the wrong part.
How did you check these files? did you check both?
Assuming Linux, what do you see if you run
sudo systemctl status openhab
Dietmar75
(Dietmar)
December 11, 2023, 7:19pm
3
Thanks, for help.
result for systemctrl:
raspi@openhabian:~ $ sudo systemctl status openhab
[sudo] password for raspi:
● openhab.service - openHAB - empowering the smart home
Loaded: loaded (/lib/systemd/system/openhab.service; enabled; vendor prese>
Drop-In: /etc/systemd/system/openhab.service.d
└─override.conf
Active: active (running) since Mon 2023-12-11 19:00:55 CET; 1h 12min ago
Docs: Introduction | openHAB
https://community.openhab.org
Process: 768 ExecStartPre=/usr/bin/rm -f /var/lock/LCK..ttyAMA0 /var/lock/L>
Main PID: 776 (java)
Tasks: 276 (limit: 1069)
CPU: 35min 1.001s
CGroup: /system.slice/openhab.service
└─776 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/ope>
Dec 11 20:11:35 openhabian karaf[776]: 20:11:35.236 [OH-rule-energy-3-1] ERROR >
Dec 11 20:11:53 openhabian karaf[776]: 20:11:53.347 [OH-rule-nest-3-1] ERROR or>
Dec 11 20:11:53 openhabian karaf[776]: 20:11:53.350 [OH-rule-nest-2-1] ERROR or>
Dec 11 20:12:11 openhabian karaf[776]: 20:12:11.468 [OH-rule-nest-3-1] ERROR or>
Dec 11 20:12:11 openhabian karaf[776]: 20:12:11.471 [OH-rule-nest-2-1] ERROR or>
Dec 11 20:12:29 openhabian karaf[776]: 20:12:29.597 [OH-rule-nest-3-1] ERROR or>
Dec 11 20:12:29 openhabian karaf[776]: 20:12:29.603 [OH-rule-nest-2-1] ERROR or>
Dec 11 20:12:47 openhabian karaf[776]: 20:12:47.709 [OH-rule-nest-3-1] ERROR or>
Dec 11 20:12:47 openhabian karaf[776]: 20:12:47.716 [OH-rule-nest-2-1] ERROR or>
lines 1-23…skipping…
● openhab.service - openHAB - empowering the smart home
Loaded: loaded (/lib/systemd/system/openhab.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/openhab.service.d
└─override.conf
Active: active (running) since Mon 2023-12-11 19:00:55 CET; 1h 12min ago
Docs: Introduction | openHAB
https://community.openhab.org
Process: 768 ExecStartPre=/usr/bin/rm -f /var/lock/LCK..ttyAMA0 /var/lock/LCK..ttyACM0 (code=exited, status=0/SUCCESS)
Main PID: 776 (java)
Tasks: 276 (limit: 1069)
CPU: 35min 1.001s
CGroup: /system.slice/openhab.service
└─776 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/ope>
Dec 11 20:11:35 openhabian karaf[776]: 20:11:35.236 [OH-rule-energy-3-1] ERROR org.openhab.core.automation.module.script.internal.handler.Script>
Dec 11 20:11:53 openhabian karaf[776]: 20:11:53.347 [OH-rule-nest-3-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptAc>
Dec 11 20:11:53 openhabian karaf[776]: 20:11:53.350 [OH-rule-nest-2-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptAc>
Dec 11 20:12:11 openhabian karaf[776]: 20:12:11.468 [OH-rule-nest-3-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptAc>
Dec 11 20:12:11 openhabian karaf[776]: 20:12:11.471 [OH-rule-nest-2-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptAc>
Dec 11 20:12:29 openhabian karaf[776]: 20:12:29.597 [OH-rule-nest-3-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptAc>
Dec 11 20:12:29 openhabian karaf[776]: 20:12:29.603 [OH-rule-nest-2-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptAc>
Dec 11 20:12:47 openhabian karaf[776]: 20:12:47.709 [OH-rule-nest-3-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptAc>
Dec 11 20:12:47 openhabian karaf[776]: 20:12:47.716 [OH-rule-nest-2-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptAc>
Dec 11 20:12:47 openhabian karaf[776]: 20:12:47.723 [OH-rule-energy-3-1] ERROR org.openhab.core.automation.module.script.internal.handler.Script>
~
~
~
~
~
~
~
~
lines 1-24/24 (END)
● openhab.service - openHAB - empowering the smart home
Loaded: loaded (/lib/systemd/system/openhab.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/openhab.service.d
└─override.conf
Active: active (running) since Mon 2023-12-11 19:00:55 CET; 1h 12min ago
Docs: Introduction | openHAB
https://community.openhab.org
Process: 768 ExecStartPre=/usr/bin/rm -f /var/lock/LCK..ttyAMA0 /var/lock/LCK..ttyACM0 (code=exited, status=0/SUCCESS)
Main PID: 776 (java)
Tasks: 276 (limit: 1069)
CPU: 35min 1.001s
CGroup: /system.slice/openhab.service
└─776 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.userdata=/var/lib/openhab -Dopenhab.>
Dec 11 20:11:35 openhabian karaf[776]: 20:11:35.236 [OH-rule-energy-3-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler - Script execution of rule with UID 'energy-3>
Dec 11 20:11:53 openhabian karaf[776]: 20:11:53.347 [OH-rule-nest-3-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler - Script execution of rule with UID ‘nest-3’ fa>
Dec 11 20:11:53 openhabian karaf[776]: 20:11:53.350 [OH-rule-nest-2-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler - Script execution of rule with UID ‘nest-2’ fa>
Dec 11 20:12:11 openhabian karaf[776]: 20:12:11.468 [OH-rule-nest-3-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler - Script execution of rule with UID ‘nest-3’ fa>
Dec 11 20:12:11 openhabian karaf[776]: 20:12:11.471 [OH-rule-nest-2-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler - Script execution of rule with UID ‘nest-2’ fa>
Dec 11 20:12:29 openhabian karaf[776]: 20:12:29.597 [OH-rule-nest-3-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler - Script execution of rule with UID ‘nest-3’ fa>
Dec 11 20:12:29 openhabian karaf[776]: 20:12:29.603 [OH-rule-nest-2-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler - Script execution of rule with UID ‘nest-2’ fa>
Dec 11 20:12:47 openhabian karaf[776]: 20:12:47.709 [OH-rule-nest-3-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler - Script execution of rule with UID ‘nest-3’ fa>
Dec 11 20:12:47 openhabian karaf[776]: 20:12:47.716 [OH-rule-nest-2-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler - Script execution of rule with UID ‘nest-2’ fa>
Dec 11 20:12:47 openhabian karaf[776]: 20:12:47.723 [OH-rule-energy-3-1] ERROR org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler - Script execution of rule with UID 'energy-3>
I could only check for a emty file, according to some posts. I can’t evaluate the conentet itself.
content of org.ops4j.pax.logging.cfg is:
org.ops4j.pax.logging.log4j2.config.file=${karaf.etc}/log4j2.xml
content of log4j2.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Appenders>
<!-- Console appender not used by default (see Root logger AppenderRefs) -->
<Console name="STDOUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n"/>
</Console>
<!-- Rolling file appender -->
<RollingFile fileName="${sys:openhab.logdir}/openhab.log" filePattern="${sys:openhab.logdir}/openhab.log.%i.gz" name="LOGFILE">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n"/>
<Policies>
<OnStartupTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="16 MB"/>
</Policies>
<DefaultRolloverStrategy max="7"/>
</RollingFile>
<!-- Event log appender -->
<RollingRandomAccessFile fileName="${sys:openhab.logdir}/events.log" filePattern="${sys:openhab.logdir}/events.log.%i.gz" name="EVENT">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n"/>
<Policies>
<OnStartupTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="16 MB"/>
</Policies>
<DefaultRolloverStrategy max="7"/>
</RollingRandomAccessFile>
<!-- Audit file appender -->
<RollingRandomAccessFile fileName="${sys:openhab.logdir}/audit.log" filePattern="${sys:openhab.logdir}/audit.log.%i.gz" name="AUDIT">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n"/>
<Policies>
<OnStartupTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="8 MB"/>
</Policies>
<DefaultRolloverStrategy max="7"/>
</RollingRandomAccessFile>
<!-- OSGi appender -->
<PaxOsgi filter="*" name="OSGI"/>
</Appenders>
<Loggers>
<!-- Root logger configuration -->
<Root level="WARN">
<AppenderRef ref="LOGFILE"/>
<AppenderRef ref="OSGI"/>
</Root>
<!-- Karaf Shell logger -->
<Logger level="OFF" name="org.apache.karaf.shell.support">
<AppenderRef ref="STDOUT"/>
</Logger>
<!-- Security audit logger -->
<Logger additivity="false" level="INFO" name="org.apache.karaf.jaas.modules.audit">
<AppenderRef ref="AUDIT"/>
</Logger>
<!-- openHAB specific logger configuration -->
<Logger level="INFO" name="org.openhab"/>
<Logger level="ERROR" name="openhab.event.ItemStateEvent"/>
<Logger level="ERROR" name="openhab.event.ItemStateUpdatedEvent"/>
<Logger level="ERROR" name="openhab.event.GroupStateUpdatedEvent"/>
<Logger level="ERROR" name="openhab.event.ItemAddedEvent"/>
<Logger level="ERROR" name="openhab.event.ItemRemovedEvent"/>
<Logger level="ERROR" name="openhab.event.ItemChannelLinkAddedEvent"/>
<Logger level="ERROR" name="openhab.event.ItemChannelLinkRemovedEvent"/>
<Logger level="ERROR" name="openhab.event.ChannelDescriptionChangedEvent"/>
<Logger level="ERROR" name="openhab.event.ThingStatusInfoEvent"/>
<Logger level="ERROR" name="openhab.event.ThingAddedEvent"/>
<Logger level="ERROR" name="openhab.event.ThingUpdatedEvent"/>
<Logger level="ERROR" name="openhab.event.ThingRemovedEvent"/>
<Logger level="ERROR" name="openhab.event.InboxUpdatedEvent"/>
<Logger level="ERROR" name="openhab.event.RuleStatusInfoEvent"/>
<Logger level="ERROR" name="openhab.event.RuleAddedEvent"/>
<Logger level="ERROR" name="openhab.event.RuleRemovedEvent"/>
<Logger level="ERROR" name="openhab.event.StartlevelEvent"/>
<Logger level="ERROR" name="openhab.event.AddonEvent"/>
<Logger additivity="false" level="INFO" name="openhab.event">
<AppenderRef ref="EVENT"/>
<AppenderRef ref="OSGI"/>
</Logger>
<Logger level="ERROR" name="javax.jmdns"/>
<Logger level="ERROR" name="org.jupnp"/>
<!-- This suppresses all Maven download issues from the log when doing feature installations -->
<!-- as we are logging errors ourselves in a nicer way anyhow. -->
<Logger level="ERROR" name="org.ops4j.pax.url.mvn.internal.AetherBasedResolver"/>
<!-- Filters known issues of pax-web (issue link to be added here). -->
<!-- Can be removed once the issues are resolved in an upcoming version. -->
<Logger level="OFF" name="org.ops4j.pax.web.pax-web-runtime"/>
<!-- Filters known issues of lsp4j, see -->
<!-- https://github.com/eclipse/smarthome/issues/4639 -->
<!-- https://github.com/eclipse/smarthome/issues/4629 -->
<!-- https://github.com/eclipse/smarthome/issues/4643 -->
<!-- Can be removed once the issues are resolved in an upcoming version. -->
<Logger level="OFF" name="org.eclipse.lsp4j"/>
<!-- Filters warnings for events that could not be delivered to a disconnected client. -->
<Logger level="ERROR" name="org.apache.cxf.jaxrs.sse.SseEventSinkImpl"/>
<!-- Filters warnings from broken connections during startup -->
<!-- https://github.com/openhab/openhab-core/issues/2998 -->
<Logger level="ERROR" name="org.apache.cxf.phase.PhaseInterceptorChain"/>
<!-- Filters known issues of KarServiceImpl, see -->
<!-- https://github.com/openhab/openhab-distro/issues/519#issuecomment-351944506 -->
<!-- Can be removed once the issues are resolved in an upcoming version. -->
<Logger level="ERROR" name="org.apache.karaf.kar.internal.KarServiceImpl"/>
<!-- Filters warnings about unavailable ciphers when JCE is not installed, see -->
<!-- https://github.com/openhab/openhab-distro/issues/999 -->
<Logger level="ERROR" name="org.apache.karaf.shell.ssh.SshUtils"/>
<!-- Filters known issues of javax.mail, see -->
<!-- https://github.com/openhab/openhab-addons/issues/5530 -->
<Logger level="ERROR" name="javax.mail"/>
<!-- Filters disconnection warnings of the ChromeCast Java API, see -->
<!-- https://github.com/openhab/openhab-addons/issues/3770 -->
<Logger level="ERROR" name="su.litvak.chromecast.api.v2.Channel"/>
<!-- Added by Karaf to prevent debug logging loops, see -->
<!-- https://issues.apache.org/jira/browse/KARAF-5559 -->
<Logger level="WARN" name="org.apache.sshd"/>
<Logger level="ERROR" name="org.openhab.io.openhabcloud"/>
<Logger level="ERROR" name="org.openhab.binding.http"/>
<Logger level="ERROR" name="org.openhab.binding.wundergroundupdatereceiver"/>
<Logger level="TRACE" name="org.openhab.binding.modbus"/>
<Logger level="INFO" name="org.openhab.binding.modbus.e3dc"/>
</Loggers>
guration>tion>
Thanks a lot for your help.
Dietmar
rlkoshak
(Rich Koshak)
December 11, 2023, 7:23pm
4
Please use full code fences when posting logs, code, or anything else where the original formatting matters.
```
code goes here
```
Dietmar75:
guration>tion>
That part doesn’t look right but without the code fences I can’t tell.
Dietmar75
(Dietmar)
December 11, 2023, 7:40pm
5
hmm,
must be a copy paste issue, reopen with winscp and vim locks correct:
<!-- Added by Karaf to prevent debug logging loops, see -->
<!-- https://issues.apache.org/jira/browse/KARAF-5559 -->
<Logger level="WARN" name="org.apache.sshd"/>
<Logger level="ERROR" name="org.openhab.io.openhabcloud"/>
<Logger level="ERROR" name="org.openhab.binding.http"/>
<Logger level="ERROR" name="org.openhab.binding.wundergroundupdatereceiver"/>
<Logger level="TRACE" name="org.openhab.binding.modbus"/>
<Logger level="INFO" name="org.openhab.binding.modbus.e3dc"/>
</Loggers>
</Configuration>
rlkoshak
(Rich Koshak)
December 11, 2023, 7:56pm
6
Assuming there isn’t another copy and paste error, you are missing the opening <Configuration monitorInterval="10"> tag
Compare the file to the standard one and look for differences.
Dietmar75
(Dietmar)
December 11, 2023, 8:05pm
7
short update,
I don’t know why, but without my conscious intervention the log setting was displayed again for the MOD bus binding.
I changed the setting from “Trace” back to “Warning”. At that moment the logging started again.
Anyway, thank you very much for your super fast support.
Greetings
Dietmar
mabra
(Manfred Braun)
January 16, 2024, 6:29am
8
Similar thing for me (complete newbie) - logging stopped completely. After I found the log-config with this thread (and have used log4net several times) I found the problem at the end of the file:
</Loggers>
</Configuration>me="org.openhab.binding.bluetooth.roaming"/>
</Loggers>
</Configuration>
Removed everything behind the first </Configuration>
and logging is back again.
I NEVER made manual changes, the last action I remember was changing the logging for bluetooth with the GUI!
Regards,
Manfred
Today I faced the same issue with OH 5.1.4 on Docker.
Before I had changed the log setting of a binding (AVM Fritz!) to TRACE. When I tried to monitor the log, nothing appeared. Several restarts and re-creation of the Docker container - nothing helped.
Then I searched for a solution and found this thread. I checked my org.ops4j.pax.logging.cfg
was empty. I re-entered this line and it worked again:
org.ops4j.pax.logging.log4j2.config.file=${karaf.etc}/log4j2.xml
After having done this, I remembered that I had this situation already some long time before. It seems to be an issue with updating the log config even through the admin UI.
From time to time I have a heavy encreasing Java heap memory with sometimes a total hangup of OH. May be this is related to the issue?
Regards Christoph
rlkoshak
(Rich Koshak)
July 21, 2026, 1:45pm
10
There is already an issue open. The problem is upstream of OH in the Apache Karaf project or the PAX project.
opened 10:32PM - 21 Feb 25 UTC
bug
OH 4.3.2 running in a docker
After trying to change multiple log settings at on… ce in the MQTT binding, the log4j2.xml file got corrupted.
Here are the settings I tried to change one shot:

After saving and going to check the log viewer, I only had this message and it only appeared when refreshing the web page:

After searching on the web it pointed to a possible log4j2.xml corrupted file and that's exactly what it was. Here is the end of the file, **it is not a typo**:
```
<Logger level="WARN" name="org.apache.sshd"/>
<Logger level="INFO" name="org.openhab.persistence.influxdb"/>
<Logger level="INFO" name="org.openhab.io.homekit"/>
<Logger level="TRACE" name="org.openhab.binding.mqtt.generic"/>
</Loggers>
</Configuration>ation>
```
After correcting the closing tag everything was working fine again.
I tried to reproduce the issue but I did not get it the second time, but I did see that you cannot actually change multiple log settings at once, it only changes one at a time, so this is also a bug since a user, like me, would think after saving and exiting that all changes would be enabled, but no. You actually see it above, only "org.openhab.binding.mqtt.generic" was changed. This issue is maybe linked to the corrupted file.
**EDIT:**
I managed to reproduce the issue by taking a file I did not edit myself from a backup. There is a difference between the original file and after I edit the file, take a look when I do a cat of the file that becomes corrupted (before it gets corrupted):

And the file after I edit and fix it, nano inserts a newline after the last line which cannot be removed:

It seems that the original file does not have a newline char after the last tag and that seems to cause the broken file issue.
**EDIT2:**
There is another issue, when you go in the MQTT settings to change the log settings and you don't change any log settings and go back without saving, it says "Changes have not been saved".
This is the better issue to link to.
opened 09:20PM - 23 Jan 25 UTC
bug
I managed several times to corrupt my log4j.xml with fast change of many
## Ex… pected Behavior
use http://openhab.local:8080/settings/addons/binding-mqtt without the risk of corrupting /var/lib/openhab/etc/log4j2.xml
## Current Behavior
When you set org.openhab.binding.mqtt to debug, all "sub loggers" will be set to debug too. change that and back and forth manually and select "default" in a fast way you can corrupt the xml. the web app page is blank, and you have no way to correct with without manually correcting the xml. Done with chromium and firefox.
```
java.lang.RuntimeException: Unable to set level for logger
at org.apache.karaf.log.core.internal.LogServiceLog4j2XmlImpl.setLevel(LogServiceLog4j2XmlImpl.java:139) ~[?:?]
at org.apache.karaf.log.core.internal.LogServiceImpl.setLevel(LogServiceImpl.java:114) ~[?:?]
at org.openhab.core.karaf.internal.LoggerResource.putLoggers(LoggerResource.java:106) ~[?:?]
.....
at java.lang.Thread.run(Thread.java:840) [?:?]
Caused by: org.xml.sax.SAXParseException: Premature end of file.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:262) ~[?:?]
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:342) ~[?:?]
```
log4j2.xml:
```
<Logger level="WARN" name="org.apache.sshd"/>
<Logger level="DEBUG" name="org.openhab.binding.mqtt.generic"/>
<Logger level="DEBUG" name="org.openhab.binding.mqtt"/>
<Logger level="INFO" name="org.openhab.binding.mqtt.espmilighthub"/>
<Logger level="INFO" name="org.openhab.binding.mqtt.ruuvigateway"/>
<Logger level="INFO" name="org.openhab.binding.mqtt.homie"/>
<Logger level="INFO" name="org.openhab.binding.mqtt.fpp"/>
</Loggers>
</Configuration>iguration>
```
## Your Environment
Version: 4.3.1 (Build)
LXC Container. Proxmox host. "bind" filesystem:
```
root@openhab:/var/lib/openhab/etc# mount
lostinspace/data/subvol-104-disk-0 on / type zfs (rw,relatime,xattr,posixacl,casesensitive)
```