Log file configuration

  • Platform information:
    • Hardware: i3 / 4 GB
    • OS: Gentoo
    • Java Runtime Environment:
    • openHAB version: 2.4.0

Hello everyone, I’m trying to properly configure the logging for my system. So far, I’ve managed to create the logging file I want, but I’d like to remove those log in those file from the other files and I can’t figure out how. For exemple, all of my debug logging are also logged into openhab.log.

Here is my current config

# 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

# Wemo script logger
log4j2.logger.wemoscript.name = org.eclipse.smarthome.model.script.WEMO
log4j2.logger.wemoscript.level = INFO
log4j2.logger.wemoscript.appenderRefs = wemoscript
log4j2.logger.wemoscript.appenderRef.wemoscript.ref = WEMOSCRIPT

# MyQ script logger
log4j2.logger.myqscript.name = org.eclipse.smarthome.model.script.MYQ
log4j2.logger.myqscript.level = INFO
log4j2.logger.myqscript.appenderRefs = myqscript
log4j2.logger.myqscript.appenderRef.myqscript.ref = MYQSCRIPT

# Ecobee script logger
log4j2.logger.ecobeescript.name = org.eclipse.smarthome.model.script.ECOBEE
log4j2.logger.ecobeescript.level = INFO
log4j2.logger.ecobeescript.appenderRefs = ecobeescript
log4j2.logger.ecobeescript.appenderRef.ecobeescript.ref = ECOBEESCRIPT

# DSC script logger
log4j2.logger.dscscript.name = org.eclipse.smarthome.model.script.DSC
log4j2.logger.dscscript.level = INFO
log4j2.logger.dscscript.appenderRefs = dscscript
log4j2.logger.dscscript.appenderRef.dscscript.ref = DSCSCRIPT

# Mysql PersistenceService logger
log4j2.logger.mysqlpersist.name = org.openhab.persistence.mysql.internal.MysqlPersistenceService
log4j2.logger.mysqlpersist.level = INFO
log4j2.logger.mysqlpersist.appenderRefs = mysqlpersist
log4j2.logger.mysqlpersist.appenderRef.dscscript.ref = MYSQLPERSIST

# Scenes script logger
log4j2.logger.scenescript.name = org.eclipse.smarthome.model.script.Scene
log4j2.logger.scenescript.level = INFO
log4j2.logger.scenescript.appenderRefs = scenescript
log4j2.logger.scenescript.appenderRef.scenescript.ref = SCENESCRIPT


# Custom script logger
log4j2.logger.cscript.name = org.eclipse.smarthome.model.script
log4j2.logger.cscript.level = INFO
log4j2.logger.cscript.appenderRefs = cscript
log4j2.logger.cscript.appenderRef.cscript.ref = CSCRIPT

# DSC Logger
log4j2.logger.dsc.name = org.openhab.binding.dscalarm
log4j2.logger.dsc.level = INFO
log4j2.logger.dsc.appenderRefs = dsc
log4j2.logger.dsc.appenderRef.dsc.ref = DSC

# MYQ Logger
log4j2.logger.myq.name = org.openhab.binding.myq
log4j2.logger.myq.level = INFO
log4j2.logger.myq.appenderRefs = myq
log4j2.logger.myq.appenderRef.myq.ref = MYQ

# MYQ 2.0 Logger  
log4j2.logger.myqc.name = org.openhab.binding.chamberlainmyq
log4j2.logger.myqc.level = INFO
log4j2.logger.myqc.appenderRefs = myqc
log4j2.logger.myqc.appenderRef.myqc.ref = MYQC

# WEMO Logger
log4j2.logger.wemo.name = org.eclipse.smarthome.binding.wemo
log4j2.logger.wemo.level = INFO
log4j2.logger.wemo.appenderRefs = wemo
log4j2.logger.wemo.appenderRef.wemo.ref = WEMO

# Bindings Debug Logger
log4j2.logger.bindingsdebug.name = org.eclipse.smarthome.binding
log4j2.logger.bindingsdebug.level = DEBUG
log4j2.logger.bindingsdebug.appenderRefs = bindingsdebug
log4j2.logger.bindingsdebug.appenderRef.bindingsdebug.ref = BINDINGSDEBUG

# weatherunderground Logger
log4j2.logger.weatherunderground.name = pse.smarthome.binding.weatherunderground
log4j2.logger.weatherunderground.level = ERROR
log4j2.logger.weatherunderground.appenderRefs = weatherunderground
log4j2.logger.weatherunderground.appenderRef.weatherunderground.ref = WEATHERUNDERGROUND

# Sony Audio Logger
log4j2.logger.sonyaudio.name = pse.smarthome.binding.sonyaudio
log4j2.logger.sonyaudio.level = INFO
log4j2.logger.sonyaudio.appenderRefs = sonyaudio
log4j2.logger.sonyaudio.appenderRef.sonyaudio.ref = SONYAUDIO

# 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.smarthomeItemStateChangedEvent.name = smarthome.event.ItemStateChangedEvent
log4j2.logger.smarthomeItemStateChangedEvent.level = ERROR
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.smarthomeThingUpdatedEvent.name = smarthome.event.ThingUpdatedEvent
log4j2.logger.smarthomeThingUpdatedEvent.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 warning for cookie
# https://community.openhab.org/t/myq-chamberlain-log-warnings/47200/15
log4j2.logger.httpclient.name = org.apache.commons.httpclient.HttpMethodBase
log4j2.logger.httpclient.level = ERROR

# 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 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

# Filters warnings about small thread pools.
# The thread pool is kept small intentionally for supporting resource constrained hardware.
log4j2.logger.threadpoolbudget.name = org.eclipse.jetty.util.thread.ThreadPoolBudget
log4j2.logger.threadpoolbudget.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

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

# 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 = 2MB

# 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 = *

# Wemo script appender
log4j2.appender.wemoscript.type = RollingRandomAccessFile
log4j2.appender.wemoscript.name = WEMOSCRIPT
log4j2.appender.wemoscript.fileName = ${openhab.logdir}/wemoscript.log
log4j2.appender.wemoscript.filePattern = ${openhab.logdir}/wemoscript.log.%i
log4j2.appender.wemoscript.append = true
log4j2.appender.wemoscript.layout.type = PatternLayout
log4j2.appender.wemoscript.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-10.80c] - %m%n
log4j2.appender.wemoscript.policies.type = Policies
log4j2.appender.wemoscript.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.wemoscript.policies.size.size = 2MB

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

# DSC script appender
log4j2.appender.dscscript.type = RollingRandomAccessFile
log4j2.appender.dscscript.name = DSCSCRIPT
log4j2.appender.dscscript.fileName = ${openhab.logdir}/dscscript.log
log4j2.appender.dscscript.filePattern = ${openhab.logdir}/dscscript.log.%i
log4j2.appender.dscscript.append = true
log4j2.appender.dscscript.layout.type = PatternLayout
log4j2.appender.dscscript.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-10.80c] - %m%n
log4j2.appender.dscscript.policies.type = Policies
log4j2.appender.dscscript.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.dscscript.policies.size.size = 2MB

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

# MyQ script appender
log4j2.appender.myqscript.type = RollingRandomAccessFile
log4j2.appender.myqscript.name = MYQSCRIPT
log4j2.appender.myqscript.fileName = ${openhab.logdir}/myqscript.log
log4j2.appender.myqscript.filePattern = ${openhab.logdir}/myqscript.log.%i
log4j2.appender.myqscript.append = true
log4j2.appender.myqscript.layout.type = PatternLayout
log4j2.appender.myqscript.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-10.80c] - %m%n
log4j2.appender.myqscript.policies.type = Policies
log4j2.appender.myqscript.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.myqscript.policies.size.size = 2MB

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

# MyQ 2.0  appender
log4j2.appender.myqc.type = RollingRandomAccessFile
log4j2.appender.myqc.name = MYQC
log4j2.appender.myqc.fileName = ${openhab.logdir}/myq2.log
log4j2.appender.myqc.filePattern = ${openhab.logdir}/myq2.log.%i
log4j2.appender.myqc.append = true
log4j2.appender.myqc.layout.type = PatternLayout
log4j2.appender.myqc.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-10.80c] - %m%n
log4j2.appender.myqc.policies.type = Policies
log4j2.appender.myqc.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.myqc.policies.size.size = 2MB

# Ecobee script appender
log4j2.appender.ecobeescript.type = RollingRandomAccessFile
log4j2.appender.ecobeescript.name = ECOBEESCRIPT
log4j2.appender.ecobeescript.fileName = ${openhab.logdir}/ecobeescript.log
log4j2.appender.ecobeescript.filePattern = ${openhab.logdir}/ecobeescript.log.%i
log4j2.appender.ecobeescript.append = true
log4j2.appender.ecobeescript.layout.type = PatternLayout
log4j2.appender.ecobeescript.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-10.80c] - %m%n
log4j2.appender.ecobeescript.policies.type = Policies
log4j2.appender.ecobeescript.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.ecobeescript.policies.size.size = 2MB

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

# Scene script appender
log4j2.appender.scenescript.type = RollingRandomAccessFile
log4j2.appender.scenescript.name = SCENESCRIPT
log4j2.appender.scenescript.fileName = ${openhab.logdir}/scenescript.log
log4j2.appender.scenescript.filePattern = ${openhab.logdir}/scenescript.log.%i
log4j2.appender.scenescript.append = true
log4j2.appender.scenescript.layout.type = PatternLayout
log4j2.appender.scenescript.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-10.80c] - %m%n
log4j2.appender.scenescript.policies.type = Policies
log4j2.appender.scenescript.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.scenescript.policies.size.size = 2MB

# Mysql persist appender
log4j2.appender.mysqlpersist.type = RollingRandomAccessFile
log4j2.appender.mysqlpersist.name = MYSQLPERSIST
log4j2.appender.mysqlpersist.fileName = ${openhab.logdir}/mysqlpersist.log
log4j2.appender.mysqlpersist.filePattern = ${openhab.logdir}/mysqlpersist.log.%i
log4j2.appender.mysqlpersist.append = true
log4j2.appender.mysqlpersist.layout.type = PatternLayout
log4j2.appender.mysqlpersist.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-10.80c] - %m%n
log4j2.appender.mysqlpersist.policies.type = Policies
log4j2.appender.mysqlpersist.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.mysqlpersist.policies.size.size = 2MB

# WeatherUnderground persist appender
log4j2.appender.weatherunderground.type = RollingRandomAccessFile
log4j2.appender.weatherunderground.name = WEATHERUNDERGROUND
log4j2.appender.weatherunderground.fileName = ${openhab.logdir}/weatherunderground.log
log4j2.appender.weatherunderground.filePattern = ${openhab.logdir}/weatherunderground.log.%i
log4j2.appender.weatherunderground.append = true
log4j2.appender.weatherunderground.layout.type = PatternLayout
log4j2.appender.weatherunderground.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-10.80c] - %m%n
log4j2.appender.weatherunderground.policies.type = Policies
log4j2.appender.weatherunderground.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.weatherunderground.policies.size.size = 2MB

# SonyAudio persist appender
log4j2.appender.sonyaudio.type = RollingRandomAccessFile
log4j2.appender.sonyaudio.name = SONYAUDIO
log4j2.appender.sonyaudio.fileName = ${openhab.logdir}/sonyaudio.log
log4j2.appender.sonyaudio.filePattern = ${openhab.logdir}/sonyaudio.log.%i
log4j2.appender.sonyaudio.append = true
log4j2.appender.sonyaudio.layout.type = PatternLayout
log4j2.appender.sonyaudio.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-10.80c] - %m%n
log4j2.appender.sonyaudio.policies.type = Policies
log4j2.appender.sonyaudio.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.sonyaudio.policies.size.size = 2MB

# Bindings debug persist appender
log4j2.appender.bindingsdebug.type = RollingRandomAccessFile
log4j2.appender.bindingsdebug.name = BINDINGSDEBUG
log4j2.appender.bindingsdebug.fileName = ${openhab.logdir}/bindingsdebug.log
log4j2.appender.bindingsdebug.filePattern = ${openhab.logdir}/bindingsdebug.log.%i
log4j2.appender.bindingsdebug.append = true
log4j2.appender.bindingsdebug.layout.type = PatternLayout
log4j2.appender.bindingsdebug.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-10.80c] - %m%n
log4j2.appender.bindingsdebug.policies.type = Policies
log4j2.appender.bindingsdebug.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.bindingsdebug.policies.size.size = 2MB