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…

log4j2.xml:
<…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"/>
                        <Policies>
                                <SizeBasedTriggeringPolicy size="10 MB"/>
                        </Policies>
                        <DefaultRolloverStrategy max="10"/>
                </RollingRandomAccessFile>

<…loggers section>

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

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

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

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!

Frank.

Hi.

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.

Mark

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

Frank.

Hi

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"/>
                </Logger>

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