Custom Logging under OH3 - Help?

Hey there everyone,
I used to have logging to a custom file working under OpenHAB 2.5… now I’m trying to get it working under OpenHAB 3 after they changed the config up… My custom GUI.log file appears, but never gets any values to it (ie. 0 bytes)… Here’s what I have so far…

<…appenders section…>

                <RollingRandomAccessFile append="true" fileName="${sys:openhab.logdir}/GUI.log" filePattern="${sys:openhab.logdir}/GUI.log.%i" immediateFlush="true" name="GUI">
                        <PatternLayout pattern="%d{HH:mm:ss} %m%n"/>
                                <SizeBasedTriggeringPolicy size="10 MB"/>
                        <DefaultRolloverStrategy max="10"/>

<…loggers section>

                <!-- GUI -->
                <Logger additivity="false" level="INFO" name="org.openhab.core.model.script.GUI">
                        <AppenderRef ref="GUI"/>

And here’s how I’m sending a Log message…

rule "Test"
  Item ZWaveUpstairsOfficeDimmer_Brightness changed
  logInfo("GUI", "Triggered!");

It’s weird… cause the Karaf console’s log:list command shows it there at log level INFO… Can anyone give me a clue as to what I might be doing wrong? I’m running out of ideas… Thanks in advance!



You may have more success if you posted your config and rules using code fences. Screenshot are almost impossible to read and make it difficult to respond in a useful way.


Sorry dude. Was in a hurry and cut-n-paste was being a pain with my VM. Original post fixed. :wink: Suggestions anyone?



Just tested and works for me.

Check the end of your log4j2.xml and make sure that there is not a line like:

<Logger level="INFO" name="org.openhab.core.model.script.GUI"/>

This would be a duplicate of:

                <!-- GUI -->
                <Logger additivity="false" level="INFO" name="org.openhab.core.model.script.GUI">
                        <AppenderRef ref="GUI"/>

and as I understand would “overwrite” the required logger.