Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
titleExample for Controller log4j2.xml Configuration
linenumberstrue
collapsetrue
<Properties>
        ...
        <Property name="SysLogLevel">Off</Property>
        <Property name="SysLogHost">joc-2-0-primary<>localhost</Property>
        <Property name="SysLogPort">4245</Property>
        ...
</Properties>

<Appenders>
        ...
        <Syslog name="logNotificationAppender" format="RFC5424" host="${SysLogHost}" port="${SysLogPort}" protocol="UDP">
            <ThresholdFilter level="WARN"/>
            <PatternLayout charset="UTF-8" pattern="<134>1 %d{yyyy-MM-dd'T'HH:mm:ss.SSS}{Etc/UTC}Z ${hostName} AgentController {
"subagentId":"&quot;controllerId&quot;:&quot;%X{js7.serverId}"&quot;,
"role":"&quot;instanceId&quot;:&quot;%X{js7.clusterNodeId}"&quot;, 
"level":"%p",
"logger":"&quot;level&quot;:&quot;%p&quot;,
&quot;logger&quot;:&quot;%c{1}"&quot;,
"message":"&quot;message&quot;:&quot;%enc{%m}{JSON}"&quot;,
"thrown":"&quot;thrown&quot;:&quot;%enc{%throwable{10}}{JSON}"&quot;}"/>
        </Syslog>
        ...
</Appenders>

<Loggers>
        ...
        <Root level="${RootLogLevel}">
            ...
            <AppenderRef ref="logNotificationAppender" level="${SysLogLevel}"/>
        </Root>
</Loggers>


Explanations:

  • SysLogLevel: By default the Off value is used that deactivates the Syslog Appender. A value WARN will forward warnings and errors to the Log Notification Service.
  • SysLogHost: The hostname of the JOC Cockpit instance operatiang the Log Notification Service.
  • SysLogPort: The port of the Log Notification Service in JOC Cockpit is required. The default value is 4245.

...

Code Block
languagexml
titleExample for Agent log4j2.xml Configuration
linenumberstrue
collapsetrue
<Properties>
        ...
        <Property name="SysLogLevel">Off</Property>
        <Property name="SysLogHost">joc-2-0-primary<>localhost</Property>
        <Property name="SysLogPort">4245</Property>
        ...
</Properties>

<Appenders>
        ...
        <Syslog name="LogNotificationAppender" format="RFC5424" host="joc-2-0-primary${SysLogHost}" port="4245${SysLogPort}" protocol="UDP">
            <ThresholdFilter level="WARN"/>
            <PatternLayout charset="UTF-8" pattern="<134>1 %d{yyyy-MM-dd'T'HH:mm:ss.SSS}{Etc/UTC}Z ${hostName} Agent {
"instanceId":"&quot;instanceId&quot;:&quot;%X{js7.serverId}"&quot;,
"role":"&quot;role&quot;:&quot;%X{js7.clusterNodeId}"&quot;,
"level":"%p",
"logger":"&quot;level&quot;:&quot;%p&quot;,
&quot;logger&quot;:&quot;%c{1}"&quot;,
"message":"&quot;message&quot;:&quot;%enc{%m}{JSON}"&quot;,
"thrown":"&quot;thrown&quot;:&quot;%enc{%throwable{10}}{JSON}"&quot;}"/>
        </Syslog>
        ...
</Appenders>

<Loggers>
        ...
        <Root level="${RootLogLevel}">
            ...
            <AppenderRef ref="logNotificationAppender" level="${SysLogLevel}"/>
        </Root>
</Loggers>


Explanations:

  • Similar to Controller Log4j configuration, see above.

...