You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Introduction

JS7 - Log Management is offered with JOC Cockpit for central receipt of warnings and errors created from log output of Controllers and Agents.

  • Service
  • Clients
    • Controller and Agents can act as clients to the Log Notification Service. The products can be configured to report warnings and errors to the Log Notification Service.
    • Users have a choice to enable forwarding of 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.

FEATURE AVAILABILITY STARTING FROM RELEASE 2.7.2

Log4j Configuration

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

The following examples explain the Log4j configuration.

Controller Log4j Configuration

The following Log4j configuration example 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 from the example file can be copied.
  • Users have to adjust settings from the <Syslog> configuration element.


Example for Controller log4j2.xml Configuration
<Appenders>
    <Syslog name="LogNotificationAppender" format="RFC5424" host="joc-2-0-primary" port="4245" 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} Controller {
"controllerId":"%X{js7.serverId}",
"instanceId":"%X{js7.clusterNodeId}",
"level":"%p",
"logger":"%c{1}",
"message":"%enc{%m}{JSON}",
"thrown":"%enc{%throwable{10}}{JSON}"}"/>
    </Syslog>
</Appenders>


Explanations:

  • <Syslog>: The XML element holds the required configuration. The following attributes are available:
    • name: users a free to choose a name for the Syslog Appender.
    • format: The value RFC5424 is required.
    • host: The hostname or IP address of JOC Cockpit operating the Log Notification Service.
    • port: The port to which the  Log Notificatio Service listens.
    • protocol: The value UDP is required.
  • <PatternLayout>: The XML element specifies the pattern used to send messages. The pattern must not be changed.

Agent Log4j Configuration

The following Log4j configuration is available from the log4j2.xml-example file in the Agent's <agent-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 from the example file can be copied.
  • Users have to adjust settings from the <Syslog> configuration element.


Example for Agent log4j2.xml Configuration
<Appenders>
    <Syslog name="LogNotificationAppender" format="RFC5424" host="joc-2-0-primary" port="4245" 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":"%X{js7.serverId}",
"role":"%X{js7.clusterNodeId}",
"level":"%p",
"logger":"%c{1}",
"message":"%enc{%m}{JSON}",
"thrown":"%enc{%throwable{10}}{JSON}"}"/>
    </Syslog>
</Appenders>


Explanations:

  • Similar to Controller Log4j configuration, see above.



  • No labels