<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" shutdownHook="disable">
    <Properties>
        <Property name="TimeZone">${env:JS7_CONTROLLER_TZ:-Etc/UTC}</Property>
        <Property name="ConsoleTarget">SYSTEM_OUT</Property>
        
        <!-- Log level of the Root Logger. -->
        <Property name="RootLogLevel">INFO</Property>
        
        <!-- Log level of the logger that uses the 'LogNotificationAppender' (OFF|WARN|ERROR)  
             If this value is set to WARN or ERROR then the 
             'SysLogHost' property has to be set with the host of the JOC Cockpit
        -->
        <Property name="SysLogLevel">OFF</Property>
        <Property name="SysLogHost">localhost</Property>
        <Property name="SysLogPort">4245</Property>
        
    </Properties>
    
    <Appenders>
        <Console name="console" target="${ConsoleTarget}">
            <PatternLayout pattern="%d{ISO8601}{${TimeZone}} %-5level JS7 %X{js7.serverId} · %X{js7.clusterNodeId} · %logger{1.} - %message %throwable{separator(\n)}%n"/>
        </Console>
        
        <Syslog name="logNotificationAppender" format="RFC5424" host="${SysLogHost}" port="${SysLogPort}" protocol="UDP">
            <ThresholdFilter level="WARN"/>
            <PatternLayout charset="UTF-8" pattern="&lt;134&gt;1 %d{yyyy-MM-dd'T'HH:mm:ss.SSS}{Etc/UTC}Z ${hostName} Controller {
&quot;controllerId&quot;:&quot;%X{js7.serverId}&quot;,
&quot;instanceId&quot;:&quot;%X{js7.clusterNodeId}&quot;,
&quot;level&quot;:&quot;%p&quot;,
&quot;logger&quot;:&quot;%c{1}&quot;,
&quot;message&quot;:&quot;%enc{%m}{JSON}&quot;,
&quot;thrown&quot;:&quot;%enc{%throwable{10}}{JSON}&quot;}"/>
        </Syslog>
        
    </Appenders>
    
    <Loggers>
        <Logger name="spray" level="INFO"/>
        <Logger name="org.apache.pekko" level="INFO"/>
        <Logger name="org.apache.pekko.event.slf4j.Slf4jLogger" level="WARN"/>
        <Logger name="org.apache.pekko.actor.CoordinatedShutdown" level="WARN"/>
        <Root level="${RootLogLevel}">
            <AppenderRef ref="console"/>
            <AppenderRef ref="logNotificationAppender" level="${SysLogLevel}"/>
        </Root>
    </Loggers>
</Configuration>
