ERROR messages not logged in File but Karaf only

Tags: #<Tag:0x00007efec0529890> #<Tag:0x00007efec05297c8>

I try to find the files containing the Error-Logs I can see on the Karat Console. I suppose this should be logged in openhab.log

07:00:00.038 [ERROR] [untime.internal.engine.ExecuteRuleJob]
07:00:25.898 [ERROR] [me.internal.engine.RuleTriggerManager]  -

I checked the file openhab.log, however this wasn’t updated since several month :thinking:
The only log files I can find which are recently updated is events.log and my custom logfile WeWe_Rules.log.

I’m not sure something is wrong in the logger configuration, which prevents to log the ERROR entries?

Thanks for your help.

# Common pattern layout for appenders
#log4j2.pattern = %d{ISO8601} | %-5p | %-16t | %-32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n

# Root logger
log4j2.rootLogger.level = WARN
log4j2.rootLogger.appenderRefs = out, osgi
log4j2.rootLogger.appenderRef.out.ref = LOGFILE
log4j2.rootLogger.appenderRef.osgi.ref = OSGI

# Karaf Shell logger
log4j2.logger.shell.name = org.apache.karaf.shell.support
log4j2.logger.shell.level = OFF
log4j2.logger.shell.appenderRefs = stdout
log4j2.logger.shell.appenderRef.stdout.ref = STDOUT

# Security audit logger
log4j2.logger.audit.name = org.apache.karaf.jaas.modules.audit
log4j2.logger.audit.level = INFO
log4j2.logger.audit.additivity = false
log4j2.logger.audit.appenderRefs = audit
log4j2.logger.audit.appenderRef.audit.ref = AUDIT

# openHAB specific logger configuration

log4j2.logger.openhab.name = org.openhab
log4j2.logger.openhab.level = INFO

log4j2.logger.smarthome.name = org.eclipse.smarthome
log4j2.logger.smarthome.level = INFO

log4j2.logger.smarthomeItemStateEvent.name = smarthome.event.ItemStateEvent
log4j2.logger.smarthomeItemStateEvent.level = ERROR
log4j2.logger.smarthomeItemAddedEvent.name = smarthome.event.ItemAddedEvent
log4j2.logger.smarthomeItemAddedEvent.level = ERROR
log4j2.logger.smarthomeItemRemovedEvent.name = smarthome.event.ItemRemovedEvent
log4j2.logger.smarthomeItemRemovedEvent.level = ERROR
log4j2.logger.smarthomeThingStatusInfoEvent.name = smarthome.event.ThingStatusInfoEvent
log4j2.logger.smarthomeThingStatusInfoEvent.level = ERROR
log4j2.logger.smarthomeThingAddedEvent.name = smarthome.event.ThingAddedEvent
log4j2.logger.smarthomeThingAddedEvent.level = ERROR
log4j2.logger.smarthomeThingRemovedEvent.name = smarthome.event.ThingRemovedEvent
log4j2.logger.smarthomeThingRemovedEvent.level = ERROR
log4j2.logger.smarthomeInboxUpdatedEvent.name = smarthome.event.InboxUpdatedEvent
log4j2.logger.smarthomeInboxUpdatedEvent.level = ERROR

log4j2.logger.events.name = smarthome.event
log4j2.logger.events.level = INFO
log4j2.logger.events.additivity = false
log4j2.logger.events.appenderRefs = event
log4j2.logger.events.appenderRef.event.ref = EVENT
log4j2.logger.events.appenderRef.osgi.ref = OSGI

log4j2.logger.jupnp.name = org.jupnp
log4j2.logger.jupnp.level = ERROR

log4j2.logger.jmdns.name = javax.jmdns
log4j2.logger.jmdns.level = ERROR

# This suppresses all Maven download issues from the log when doing feature installations
# as we are logging errors ourselves in a nicer way anyhow.
log4j2.logger.paxurl.name = org.ops4j.pax.url.mvn.internal.AetherBasedResolver
log4j2.logger.paxurl.level = ERROR

# Filters known issues of pax-web (issue link to be added here).
# Can be removed once the issues are resolved in an upcoming version.
log4j2.logger.paxweb.name = org.ops4j.pax.web.pax-web-runtime
log4j2.logger.paxweb.level = OFF

# 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.
log4j2.logger.lsp4j.name = org.eclipse.lsp4j
log4j2.logger.lsp4j.level = OFF


# Filters known issues of javax.mail, see
# https://github.com/openhab/openhab2-addons/issues/5530
log4j2.logger.javaxmail.name = javax.mail
log4j2.logger.javaxmail.level = ERROR


# 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.
log4j2.logger.karservice.name = org.apache.karaf.kar.internal.KarServiceImpl
log4j2.logger.karservice.level = ERROR



# Appenders configuration

# Console appender not used by default (see log4j2.rootLogger.appenderRefs)
log4j2.appender.console.type = Console
log4j2.appender.console.name = STDOUT
log4j2.appender.console.layout.type = PatternLayout
log4j2.appender.console.layout.pattern = %d{HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n



# Event log appender
log4j2.appender.event.type = RollingRandomAccessFile
log4j2.appender.event.name = EVENT
log4j2.appender.event.fileName = ${openhab.logdir}/events.log
log4j2.appender.event.filePattern = ${openhab.logdir}/events.log.%i
log4j2.appender.event.immediateFlush = true
log4j2.appender.event.append = true
log4j2.appender.event.layout.type = PatternLayout
log4j2.appender.event.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-26.26c] - %m%n
log4j2.appender.event.policies.type = Policies
log4j2.appender.event.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.event.policies.size.size = 16MB

# Audit file appender
log4j2.appender.audit.type = RollingRandomAccessFile
log4j2.appender.audit.name = AUDIT
log4j2.appender.audit.fileName = ${openhab.logdir}/audit.log
log4j2.appender.audit.filePattern = ${openhab.logdir}/audit.log.%i
log4j2.appender.audit.append = true
log4j2.appender.audit.layout.type = PatternLayout
log4j2.appender.audit.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n
log4j2.appender.audit.policies.type = Policies
log4j2.appender.audit.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.audit.policies.size.size = 8MB

# OSGi appender
log4j2.appender.osgi.type = PaxOsgi
log4j2.appender.osgi.name = OSGI
log4j2.appender.osgi.filter = *

log4j2.logger.smarthome\:homekit.level = DEBUG
log4j2.logger.smarthome\:homekit.name = smarthome:homekit
log4j2.logger.com_beowulfe_hap.level = TRACE
log4j2.logger.com_beowulfe_hap.name = com.beowulfe.hap

log4j2.logger.org_apache_sshd.level = ERROR
log4j2.logger.org_apache_sshd.name = org.apache.sshd

log4j2.logger.communicator_abstracthomematicgateway.level = DEBUG
log4j2.logger.communicator_abstracthomematicgateway.name = communicator.AbstractHomematicGateway

log4j2.logger.org_eclipse_smarthome_binding_homematic.level = INFO
log4j2.logger.org_eclipse_smarthome_binding_homematic.name = org.eclipse.smarthome.binding.homematic



  ### Custom Loggers ###
# WeWe_Rules
log4j2.logger.WeWe_Rules.name = org.eclipse.smarthome.model.script
log4j2.logger.WeWe_Rules.level = DEBUG
log4j2.logger.WeWe_Rules.additivity = false
log4j2.logger.WeWe_Rules.appenderRefs = WeWe_Rules
log4j2.logger.WeWe_Rules.appenderRef.WeWe_Rules.ref = WeWe_Rules

### Custom Appenders ###
# WeWe_Rules
log4j2.appender.WeWe_Rules.name = WeWe_Rules
log4j2.appender.WeWe_Rules.type = RollingRandomAccessFile
log4j2.appender.WeWe_Rules.fileName = ${openhab.logdir}/WeWe_Rules.log
log4j2.appender.WeWe_Rules.filePattern = ${openhab.logdir}/WeWe_Rules.log.%i
log4j2.appender.WeWe_Rules.immediateFlush = true
log4j2.appender.WeWe_Rules.append = true
log4j2.appender.WeWe_Rules.layout.type = PatternLayout
log4j2.appender.WeWe_Rules.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n
log4j2.appender.WeWe_Rules.policies.type = Policies
log4j2.appender.WeWe_Rules.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.WeWe_Rules.policies.size.size = 10MB
log4j2.appender.WeWe_Rules.strategy.type = DefaultRolloverStrategy
log4j2.appender.WeWe_Rules.strategy.max = 10

I am no expert but you may want to compare your configuration with the logging examples in the zwave binding docs. The explain how to break the loggiing into a separate file.

The logging config changes from time to time, you may want to download the recent version and apply it:

(just add your custom logging to it)

1 Like

Found the issue - Rolling file appender section was missing in my file somehow. Seems to removed it by mistake :frowning:
Thanks for the hints!

1 Like