Versions Compared

Key

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

...

JS7 - Log Management is offered with JOC Cockpit acting as a central point of view for monitoring of log output and dispatch of notifications created by JS7 productsController, Agent & JOC Cockpit instances.

  • Service
    • The JS7 - Log Notification Service is used to collect warnings and errors from log output of Controller & Agent instances and to create JS7 - Notifications. JOC Cockpit notifications are created directly and without use of the service.
    • log output from Controllers and Agents. The service is compliant to RFC5424, aka Syslog Protocol .The Log Management Service and offers restart capabilities.
  • Clients
    • Controller and Agents & Agent instances can act as clients to the Log Management Notification Service. The products can be configured to report warnings and errors and warnings to the Log Management Notification Service.
    • Users have a choice to enable forwarding of log output warnings and errors during installation or later on by adjusting the Log4j configuration.
  • User Interface
    • The JOC Cockpit offers notifications from the JS7 - Monitor view.

Display feature availability
StartingFromRelease2.7.2

...

By default the Log4j configuration of Controller and Agents & Agent instances will not make use of the Log Management Notification Service. Instead, users choose for which instances of Controllers and Agents JS7 products they want to send errors and warnings to the Log Management ServiceNotification Service.

As a prerequisite the host and port used for the Log Notification Service have to be accessible for JS7 products.

The following examples explain the Log4j configuration.

...

The following Log4j configuration example extract is available from the log4j2.xml-example file in the Controller's <controller-data>/config directory.

  • Users can copy the log4j2.xml-example file to a file with the name log4j2.xml. Should this file exist, then the <Syslog> element and related <Properties> elements from the example file can be copied.
  • Users have to adjust settings from the <Properties> configuration elements. No changes must be applied to the <Syslog> configuration element.


Code Block
languagexml
titleExample for Controller log4j2.xml Configuration
linenumberstrue
collapsetrue
<Appenders><Properties>
        ...
    <Syslog    <Property name="RFC5424SysLogLevel" format>Off</Property>
        <Property name="RFC5424" host="localhost" port="4514"SysLogHost">localhost</Property>
        <Property name="SysLogPort">4245</Property>
        ...
</Properties>

<Appenders>
        ...
     protocol="UDP" charset="UTF-8" facility="LOCAL0" newLine="false"   <Syslog name="logNotificationAppender" format="RFC5424" host="${SysLogHost}" port="${SysLogPort}" protocol="UDP">
            <ThresholdFilter level="WARN"/>
            <PatternLayout charset="UTF-8" pattern="<134>1 %d{ISO8601yyyy-MM-dd'T'HH:mm:ss.SSS}{ETCEtc/UTC}Z ${hostName} JS7 Controller {
"host":"${hostName}",
"controllerId":"${ControllerId}",
"thread":"%t",
"level":"%p",
"logger":"%c{1}",
"message":"&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;,
"thrown":"&quot;thrown&quot;:&quot;%enc{%throwable{10}}{JSON}&quot;}"/>
        </Syslog>
        ...
</Appenders>

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


Explanations:

  • <Syslog>: The XML element holds the required configuration. The following attributes are available:
    name: users a free to choose a name for 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
  • format: The value RFC5424 is required.
  • host: The hostname or IP address of the JOC Cockpit operating instance operatiang the Log Management Notification Service.
  • portSysLogPort: The port to which the  Log Management Service listens.protocol: The value UDP of the Log Notification Service in JOC Cockpit is required. charset: The default value UTF-8 is required.
  • facility: The value LOCAL0 is required
  • newLine: The value false is required.
  • <PatternLayout>: The XML element specifies the pattern used to send messages. The pattern must not be changed.
  • 4245.

Agent Log4j Configuration

...

  • Users can copy the log4j2.xml-example file to a file with the name log4j2.xml. Should this file exist, then the <Syslog> element from and related <Properties> elements from the example file can be copied.
  • Users have to adjust settings from the <Properties> configuration elements. No changes must be applied to the <Syslog> configuration element.

...

Code Block
languagexml
titleExample for Agent log4j2.xml Configuration
linenumberstrue
collapsetrue
<Appenders><Properties>
        ...
    <Syslog    <Property name="RFC5424SysLogLevel" format>Off</Property>
        <Property name="RFC5424" host="localhost" port="4514"SysLogHost">localhost</Property>
        <Property name="SysLogPort">4245</Property>
        ...
</Properties>

<Appenders>
        ...
      protocol="UDP" charset="UTF-8" facility="LOCAL0" newLine="false"  <Syslog name="LogNotificationAppender" format="RFC5424" host="${SysLogHost}" port="${SysLogPort}" protocol="UDP">
            <ThresholdFilter level="WARN"/>
            <PatternLayout charset="UTF-8" pattern="<134>1 %d{ISO8601yyyy-MM-dd'T'HH:mm:ss.SSS}{ETCEtc/UTC}Z ${hostName} JS7 ControllerAgent {
"host":"${hostName}",
"controllerId":"${ControllerId}",
"agentId":"...",
"level":"%p",
"logger":"%c{1}",
"message":"&quot;instanceId&quot;:&quot;%X{js7.serverId}&quot;,
&quot;role&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;,
"thrown":"&quot;thrown&quot;:&quot;%enc{%throwable{10}}{JSON}&quot;}"/>
        </Syslog>
        ...
</Appenders>

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


Explanations:

  • Similar to Controller Log4j configuration, see above.

...