OH stops logging, need help

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

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

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

Please use full code fences when posting logs, code, or anything else where the original formatting matters.

```
code goes here
```

That part doesn’t look right but without the code fences I can’t tell.

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>

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.

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

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