Seite 2 von 5

Re: Logging in openHAB

Verfasst: 6. Jan 2021 22:17
von udo1toni
Nein, so funktioniert es nicht :) Wie gesagt, Rules sind Rules. Alles, was dort mittels logDebug() bis logError() geloggt wird, landet in einer log Datei, unabhängig vom Loggernamen, es sei denn, Du gibst explizit den gesamten Loggernamen an.

Re: Logging in openHAB

Verfasst: 6. Jan 2021 22:35
von Cyrelian
MrCrashy hat geschrieben: 6. Jan 2021 20:00 Guten Abend. Ich habe mir dein HowTo angeschaut und muss sagen, dass ich genau nach sowas gebraucht habe! Ich habe deine Einstellung übernommen und etwas nach meinen belieben angepasst. Zum Beispiel wollte ich ein Log alleine für die Beleuchtung haben. Diese sollte eigentlich in dem "lighting" - Log abgespeichert werden. Diese Log-Datei wurde auch automatisch erstellt.
Mein Command sieht so aus:

Code: Alles auswählen

logInfo("lighting", "Kinomodus wurde ohne Licht gestartet.")
Komischerweise wird es trotzdem noch in meinem openhab-Log gespeichert. Die "lighting"-Datei bleibt leer.
Hi MrCrashy,

post doch mal bitte dein Konfig-File. Dann können wir dir zeigen, wie man es anpassen muss.

CU
Cyrelian

Re: Logging in openHAB

Verfasst: 7. Jan 2021 06:51
von MrCrashy
Hallo, das ist meine gesamte Config:

Code: Alles auswählen

# 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

# ----------------------Custom Log Levels (Events & Bindings)----------------------
# Custom Log Levels (Events)
log4j2.logger.smarthomeChannelTriggeredEvent.name = smarthome.event.ChannelTriggeredEvent
log4j2.logger.smarthomeChannelTriggeredEvent.level = INFO
log4j2.logger.smarthomeConfigStatusInfoEvent.name = smarthome.event.ConfigStatusInfoEvent
log4j2.logger.smarthomeConfigStatusInfoEvent.level = WARN
log4j2.logger.smarthomeExtensionEvent.name = smarthome.event.ExtensionEvent
log4j2.logger.smarthomeExtensionEvent.level = WARN
log4j2.logger.smarthomeGroupItemStateChangedEvent.name = smarthome.event.GroupItemStateChangedEvent
log4j2.logger.smarthomeGroupItemStateChangedEvent.level = WARN
log4j2.logger.smarthomeInboxAddedEvent.name = smarthome.event.InboxAddedEvent
log4j2.logger.smarthomeInboxAddedEvent.level = WARN
log4j2.logger.smarthomeInboxRemovedEvent.name = smarthome.event.InboxRemovedEvent
log4j2.logger.smarthomeInboxRemovedEvent.level = WARN
log4j2.logger.smarthomeItemChannelLinkAddedEvent.name = smarthome.event.ItemChannelLinkAddedEvent
log4j2.logger.smarthomeItemChannelLinkAddedEvent.level = WARN
log4j2.logger.smarthomeItemChannelLinkRemovedEvent.name = smarthome.event.ItemChannelLinkRemovedEvent
log4j2.logger.smarthomeItemChannelLinkRemovedEvent.level = WARN
log4j2.logger.smarthomeItemCommandEvent.name = smarthome.event.ItemCommandEvent
log4j2.logger.smarthomeItemCommandEvent.level = INFO
log4j2.logger.smarthomeItemStatePredictedEvent.name = smarthome.event.ItemStatePredictedEvent
log4j2.logger.smarthomeItemStatePredictedEvent.level = INFO
log4j2.logger.smarthomeItemStateChangedEvent.name = smarthome.event.ItemStateChangedEvent
log4j2.logger.smarthomeItemStateChangedEvent.level = WARN
log4j2.logger.smarthomeThingStatusInfoChangedEvent.name = smarthome.event.ThingStatusInfoChangedEvent
log4j2.logger.smarthomeThingStatusInfoChangedEvent.level = INFO
log4j2.logger.smarthomeThingUpdatedEvent.name = smarthome.event.ThingUpdatedEvent
log4j2.logger.smarthomeThingUpdatedEvent.level = WARN
 # An I/O error has occurred while writing a response message entity to the container output stream, see
 # https://github.com/openhab/openhab-distro/issues/587
log4j2.logger.ioError1.name = org.glassfish.jersey.server.ServerRuntime$Responder
log4j2.logger.ioError1.level = OFF
log4j2.logger.ioError2.name = org.glassfish.jersey.server.internal.process.MappableException
log4j2.logger.ioError2.level = OFF
log4j2.logger.ioError3.name = org.eclipse.jetty.io.EofException
log4j2.logger.ioError3.level = OFF

# Custom Log Levels (Bindings)
log4j2.logger.org_openhab_binding_mqtt.name = org.openhab.binding.mqtt
log4j2.logger.org_openhab_binding_mqtt.level = WARN
log4j2.logger.org_openhab_binding_ntp.name = org.openhab.binding.ntp
log4j2.logger.org_openhab_binding_ntp.level = WARN
log4j2.logger.org_openhab_binding_unifi.name = org.openhab.binding.unifi
log4j2.logger.org_openhab_binding_unifi.level = WARN
log4j2.logger.org_openhab_binding_weather.name = org.openhab.binding.weather
log4j2.logger.org_openhab_binding_weather.level = WARN
log4j2.logger.org_openhab_persistence_influxdb.name = org.openhab.persistence.influxdb
log4j2.logger.org_openhab_persistence_influxdb.level = WARN
log4j2.logger.org_openhab_binding_samsungtv.name = org.openhab.binding.samsungtv
log4j2.logger.org_openhab_binding_samsungtv.level = WARN
log4j2.logger.org_openhab_io_homekit.name = org.openhab.io.homekit
log4j2.logger.org_openhab_io_homekit.level = WARN
log4j2.logger.org_openhab_io_transport_mqtt.name = org.openhab.io.transport.mqtt
log4j2.logger.org_openhab_io_transport_mqtt.level = WARN
log4j2.logger.org_openhab_ui_paperui.name = org.openhab.ui.paperui
log4j2.logger.org_openhab_ui_paperui.level = WARN
log4j2.logger.org_openhab_ui_basicui.name = org.openhab.ui.basicui
log4j2.logger.org_openhab_ui_basicui.level = WARN
log4j2.logger.smarthome_ui_paper.name = smarthome.ui.paper
log4j2.logger.smarthome_ui_paper.level = WARN
log4j2.logger.smarthome_ui_basic.name = smarthome.ui.basic
log4j2.logger.smarthome_ui_basic.level = WARN
log4j2.logger.smarthome_transform_jsonpath.name = smarthome.transform.jsonpath
log4j2.logger.smarthome_transform_jsonpath.level = WARN
log4j2.logger.smarthome_transform_map.name = smarthome.transform.map
log4j2.logger.smarthome_transform_map.level = WARN
log4j2.logger.smarthome_transform_regex.name = smarthome.transform.regex
log4j2.logger.smarthome_transform_regex.level = WARN

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

log4j2.logger.paperui.name = org.openhab.ui.paper
log4j2.logger.paperui.level = WARN
log4j2.logger.paperuiint.name = org.openhab.ui.paper.internal
log4j2.logger.paperuiint.level = INFO

# 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 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 unavailable ciphers when JCE is not installed, see
# https://github.com/openhab/openhab-distro/issues/999
log4j2.logger.sshutils.name = org.apache.karaf.shell.ssh.SshUtils
log4j2.logger.sshutils.level = ERROR

# 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

# 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] [%-40.40c] - %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] [%-40.40c] - %m%n
log4j2.appender.out.policies.type = Policies
log4j2.appender.out.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.out.policies.size.size = 16MB

# 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} [%-40.40c] - %m%n
log4j2.appender.event.policies.type = Policies
log4j2.appender.event.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.event.policies.size.size = 16MB

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] [%-40.40c] - %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 = *

# ----------------------Custom Loggers (Rules)----------------------

# Default Rules files logger
log4j2.logger.rules.name = org.eclipse.smarthome.model.script.rules
log4j2.logger.rules.level = INFO
log4j2.logger.rules.additivity = false
log4j2.logger.rules.appenderRefs = rules
log4j2.logger.rules.appenderRef.stdout.ref = RULES

# Default Lighting files logger
log4j2.logger.lighting.name = org.eclipse.smarthome.model.script.rules
log4j2.logger.lighting.level = INFO
log4j2.logger.lighting.additivity = false
log4j2.logger.lighting.appenderRefs = lighting
log4j2.logger.lighting.appenderRef.stdout.ref = LIGHTING

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

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


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


# # iCloud File Appender - iCloud.log
# log4j2.appender.iCloud.name = ICLOUD
# log4j2.appender.iCloud.type = RollingRandomAccessFile
# log4j2.appender.iCloud.fileName = ${openhab.logdir}/iCloud.log
# log4j2.appender.iCloud.filePattern = ${openhab.logdir}/iCloud.log.%i
# log4j2.appender.iCloud.immediateFlush = true
# log4j2.appender.iCloud.append = true
# log4j2.appender.iCloud.layout.type = PatternLayout
# log4j2.appender.iCloud.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-40.40c] - %m%n
# log4j2.appender.iCloud.policies.type = Policies
# log4j2.appender.iCloud.policies.size.type = SizeBasedTriggeringPolicy
# log4j2.appender.iCloud.policies.size.size = 10MB
# log4j2.appender.iCloud.strategy.type = DefaultRolloverStrategy
# log4j2.appender.iCloud.strategy.max = 10
Bin davon ausgegangen, dass ich die Zeilen für die Rules auch einfach für das "lighting" anwenden kann.

Re: Logging in openHAB

Verfasst: 7. Jan 2021 07:47
von sihui
MrCrashy hat geschrieben: 6. Jan 2021 20:00 Zum Beispiel wollte ich ein Log alleine für die Beleuchtung haben.
udo1toni hat geschrieben: 6. Jan 2021 21:11 Gewöhnlich kannst Du nicht bestimmte Rule Logs in unterschiedliche Dateien lenken.
Eigentlich schon, ich logge z.B. alle mit "EXTRA" getagte logInfo's in ein separates extra.log:

Code: Alles auswählen

logInfo("EXTRA","Test extra.log")

Code: Alles auswählen

<!-- EXTRA file appender (not default) -->
<RollingRandomAccessFile "${sys:openhab.logdir}/extra.log" filePattern="${sys:openhab.logdir}/extra.log.%i" name="EXTRA">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n"/>
<Policies>
<OnStartupTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="8 MB"/>
</Policies>
</RollingRandomAccessFile>

Code: Alles auswählen

<!-- EXTRA logger (not default) -->
<Logger additivity="false" level="INFO" name="org.openhab.core.model.script.EXTRA">
<AppenderRef ref="EXTRA"/>
</Logger>

Edit: achso, ich sehe gerade es geht um das alte openHAB2 Format, da geht das natürlich auch:

Code: Alles auswählen

# EXTRA Logger
log4j2.logger.rules.name = org.eclipse.smarthome.model.script.EXTRA
log4j2.logger.rules.level = INFO
log4j2.logger.rules.additivity = false
log4j2.logger.rules.appenderRefs = Extra
log4j2.logger.rules.appenderRef.Extra.ref = EXTRA

# EXTRA Appender
log4j2.appender.Extra.name = EXTRA
log4j2.appender.Extra.type = RollingRandomAccessFile
log4j2.appender.Extra.fileName = fileName="${sys:openhab.logdir}/extra.log
log4j2.appender.Extra.filePattern = filePattern="${sys:openhab.logdir}/extra.log.%i
log4j2.appender.Extra.immediateFlush = true
log4j2.appender.Extra.append = true
log4j2.appender.Extra.layout.type = PatternLayout
log4j2.appender.Extra.layout.pattern = %d{dd-MMM-yyyy HH:mm:ss.SSS} [%-5.5p] [%-50.50c] - %m%n
log4j2.appender.Extra.policies.type = Policies
log4j2.appender.Extra.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.Extra.policies.size.size = 10MB
log4j2.appender.Extra.strategy.type = DefaultRolloverStrategy
log4j2.appender.Extra.strategy.max = 10

Re: Logging in openHAB

Verfasst: 7. Jan 2021 12:23
von udo1toni
Dann landen die logs aber immer noch in openhab.log, oder nicht?

Re: Logging in openHAB

Verfasst: 7. Jan 2021 13:54
von Cyrelian
udo1toni hat geschrieben: 7. Jan 2021 12:23 Dann landen die logs aber immer noch in openhab.log, oder nicht?
Hi Udo,

nein, die werden dann in das extra.log geleitet.

CU
Cyrelian

Re: Logging in openHAB

Verfasst: 7. Jan 2021 13:59
von MrCrashy
Doch, bei mir ist das der Fall. Meine Config-Datei habe ich oben ja gepostet. So sieht sie jetzt auch aus.
Wenn ich jetzt folgenden Befehl verwende:

Code: Alles auswählen

logInfo("lighting", "Kinomodus wurde ohne Licht gestartet.")
Dann landet der Befehl immer noch im openhab.log

Re: Logging in openHAB

Verfasst: 7. Jan 2021 14:22
von sihui
MrCrashy hat geschrieben: 7. Jan 2021 13:59 Dann landet der Befehl immer noch im openhab.log
Dann ändere sie nach meinem Beispiel ab.

Re: Logging in openHAB

Verfasst: 7. Jan 2021 14:46
von Cyrelian
Hi,

here you go ;) .

Code: Alles auswählen

# LIGHTING Logger
log4j2.logger.lighting.name = org.eclipse.smarthome.model.script.lighting
log4j2.logger.lighting.level = INFO
log4j2.logger.lighting.additivity = false
log4j2.logger.lighting.appenderRefs = lighting
log4j2.logger.lighting.appenderRef.lighting.ref = LIGHTING

# LIGHTING Appender
log4j2.appender.Sonos.name = LIGHTING
log4j2.appender.Sonos.type = RollingRandomAccessFile
log4j2.appender.Sonos.fileName = ${openhab.logdir}/lighting.log
log4j2.appender.Sonos.filePattern = ${sys:openhab.logdir}/lighting.log.%i
log4j2.appender.Sonos.immediateFlush = true
log4j2.appender.Sonos.append = true
log4j2.appender.Sonos.layout.type = PatternLayout
log4j2.appender.Sonos.layout.pattern = %d{dd-MMM-yyyy HH:mm:ss.SSS} [%-5.5p] [%-40.40c] - %m%n
log4j2.appender.Sonos.policies.type = Policies
log4j2.appender.Sonos.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.Sonos.policies.size.size = 10MB
log4j2.appender.Sonos.strategy.type = DefaultRolloverStrategy
log4j2.appender.Sonos.strategy.max = 10
log4j2.logger.rules.appenderRefs = lighting
ACHTUNG!!!! case sensitive

So ist richtig und landet dann im lighting.log

Code: Alles auswählen

logInfo("lighting",.....
So ist falsch und landet im openhab.log

Code: Alles auswählen

logInfo("Lighting",.....
CU
Cyrelian

Re: Logging in openHAB

Verfasst: 7. Jan 2021 15:21
von MrCrashy
Ich habe deine Config-Daten jetzt eingefügt. Beim Starten von openhab habe ich jetzt folgende anzeige:

Code: Alles auswählen

org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Cannot access RandomAccessFile java.io.IOException: Could not create directory C:\openHAB\userdata\fileName=" Ignored FQCN: org.apache.logging.log4j.spi.AbstractLogger
java.io.IOException: Could not create directory C:\openHAB\userdata\fileName="
        at org.apache.logging.log4j.core.util.FileUtils.mkdir(FileUtils.java:127)
        at org.apache.logging.log4j.core.util.FileUtils.makeParentDirs(FileUtils.java:144)
        at org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFileManager$RollingRandomAccessFileManagerFactory.createManager(RollingRandomAccessFileManager.java:218)
        at org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFileManager$RollingRandomAccessFileManagerFactory.createManager(RollingRandomAccessFileManager.java:191)
        at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:113)
        at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:114)
        at org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFileManager.getRollingRandomAccessFileManager(RollingRandomAccessFileManager.java:108)
        at org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender$Builder.build(RollingRandomAccessFileAppender.java:133)
        at org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender$Builder.build(RollingRandomAccessFileAppender.java:53)
        at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1002)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:942)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:934)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:552)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:241)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:288)
        at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:579)
        at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:285)
        at org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.configureLog4J2(PaxLoggingServiceImpl.java:409)
        at org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.updated(PaxLoggingServiceImpl.java:272)
        at org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl$1ManagedPaxLoggingService.updated(PaxLoggingServiceImpl.java:569)
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1118)
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1074)
        at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138)
        at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105)
        at java.lang.Thread.run(Thread.java:748)
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Could not create plugin of type class org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender for element RollingRandomAccessFile: java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFileManager$RollingRandomAccessFileManagerFactory@74e908cd] unable to create manager for [fileName="/lighting.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFileManager$FactoryData@71288367] Ignored FQCN: org.apache.logging.log4j.spi.AbstractLogger
java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFileManager$RollingRandomAccessFileManagerFactory@74e908cd] unable to create manager for [fileName="/lighting.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFileManager$FactoryData@71288367]
        at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:115)
        at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:114)
        at org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFileManager.getRollingRandomAccessFileManager(RollingRandomAccessFileManager.java:108)
        at org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender$Builder.build(RollingRandomAccessFileAppender.java:133)
        at org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender$Builder.build(RollingRandomAccessFileAppender.java:53)
        at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1002)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:942)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:934)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:552)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:241)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:288)
        at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:579)
        at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:285)
        at org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.configureLog4J2(PaxLoggingServiceImpl.java:409)
        at org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.updated(PaxLoggingServiceImpl.java:272)
        at org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl$1ManagedPaxLoggingService.updated(PaxLoggingServiceImpl.java:569)
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1118)
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1074)
        at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138)
        at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105)
        at java.lang.Thread.run(Thread.java:748)
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to invoke factory method in class org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender for element RollingRandomAccessFile: java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender Ignored FQCN: org.apache.logging.log4j.spi.AbstractLogger
java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender
        at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod(PluginBuilder.java:234)
        at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:134)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1002)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:942)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:934)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:552)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:241)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:288)
        at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:579)
        at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:285)
        at org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.configureLog4J2(PaxLoggingServiceImpl.java:409)
        at org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.updated(PaxLoggingServiceImpl.java:272)
        at org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl$1ManagedPaxLoggingService.updated(PaxLoggingServiceImpl.java:569)
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1118)
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1074)
        at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138)
        at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105)
        at java.lang.Thread.run(Thread.java:748)
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Null object returned for RollingRandomAccessFile in Appenders. Ignored FQCN: org.apache.logging.log4j.spi.AbstractLogger
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to locate appender "LIGHTING" for logger config "org.eclipse.smarthome.model.script.LIGHTING" Ignored FQCN: org.apache.logging.log4j.spi.AbstractLogger
Und es wird immer noch alles im openhab.log angezeigt :?: