Page History
Table of Contents |
---|
Introduction
JS7 allows - Log Managementis offered with JOC Cockpit offering a central view for monitoring of log output and dispatch of notifications created by JS7 productsController, Agent & JOC Cockpit instances.
- Service
- The JS7 - Log Management Notification Service is compliant to RFC5424, aka Syslog Protocol.
- The Log Management Service is available from JOC Cockpit within the scope of JS7 - Services.
- The Log Management Service offers restart capabilities: in case of fail-over or switch-over of JOC Cockpit the Log Management Service will become available from the active JOC Cockpit instance.
- 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.
- The service is compliant to RFC5424, aka Syslog Protocol and offers restart capabilities.
- Clients
- Controller & Agent instances
- The JS7 products, JOC Cockpit, Controller and Agents can act as clients to the Log Management Notification Service. The products can be configured to report log output warnings and errors to the Log Management Service.In addition, log output of JS7 products is always written to local log filesNotification Service.
- Users have a choice to enable forwarding of log output per instance of a JS7 product warnings and errors during installation or later on by adjusting the Log4j2 Log4j configuration.
- User Interface
- The
...
- JOC Cockpit offers notifications from the JS7 - Monitor view.
Display feature availability | ||
---|---|---|
|
...
Log4j Configuration
By default the Log4j configuration of JS7 products Controller & Agent instances will not make use of the Log Management Notification Service. Instead, users choose for which instances of JS7 products they want to send log output 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.
Controller
...
Log4j Configuration
The following Log4j2 Log4j configuration 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 namelog4j2.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.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<Appenders> <Properties> ... <Syslog <Property name="RFC5424" format="RFC5424" host="localhost" port="4514"SysLogLevel">Off</Property> <Property name="SysLogHost">localhost</Property> <Property name="SysLogPort">4245</Property> ... </Properties> <Appenders> ... <Syslog name="logNotificationAppender" format="RFC5424" protocolhost="UDP${SysLogHost}" charsetport="UTF-8${SysLogPort}" facilityprotocol="LOCAL0UDP" newLine> <ThresholdFilter level="falseWARN"/> <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":""controllerId":"%X{js7.serverId}", "instanceId":"%X{js7.clusterNodeId}", "level":"%p", "logger":"%c{1}", "message":"%enc{%m}{JSON}"", "thrown":""thrown":"%enc{%throwable{10}}{JSON}"}"/> </Syslog> ... </Appenders> <Loggers> ... <Root level="${RootLogLevel}"> ... <AppenderRef ref="logNotificationAppender" level="${SysLogLevel}"/> </Syslog>Root> </Appenders> |
Explanations:
- tbd
Loggers> |
Explanations:
SysLogLevel
: By default theOff
value is used that deactivates the Syslog Appender. A valueWARN
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 is4245
.
Agent Log4j
...
Configuration
The following Log4j2 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 namelog4j2.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 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<Appenders><Properties> <Syslog name="RFC5424" format="RFC5424" host="localhost" port="4514" ... <Property name="SysLogLevel">Off</Property> protocol="UDP" charset="UTF-8" facility="LOCAL0" newLine="false"> <Property name="SysLogHost">localhost</Property> <PatternLayout<Property patternname="<134>1 %d{ISO8601}{ETC/UTC}Z ${hostName} JS7 Controller { "host":"${hostName}", "controllerId":"${ControllerId}", "agentId":"...", "level":"%p", "logger":"%c{1}", "message":"%enc{%m}{JSON}", "thrown":"%enc{%throwable{10}}{JSON}" }""SysLogPort">4245</Property> ... </Properties> <Appenders> />... </Syslog> </Appenders> |
Explanations:
- tbd
JOC Cockpit Log4j2 Configuration
The following Log4j2 configuration is available from the log4j2.xml-example
file in the JOC Cockpit's <jetty-base>/resources/joc
directory:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<Appenders> <Syslog name="RFC5424LogNotificationAppender" format="RFC5424" host="localhost${SysLogHost}" port="4514" "${SysLogPort}" protocol="UDP"> <ThresholdFilter protocollevel="UDPWARN" charset="UTF-8" facility="LOCAL0" newLine="false"> /> <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":""instanceId":"%X{js7.serverId}", "role":"%X{js7.clusterNodeId}", "level":"%p", "logger":"%c{1}", "message":"%enc{%m}{JSON}"", "thrown":""thrown":"%enc{%throwable{10}}{JSON}"}"/> </Syslog> ... </Appenders> <Loggers> ... <Root level="${RootLogLevel}"> ... <AppenderRef ref="logNotificationAppender" level="${SysLogLevel}"/> </Syslog>Root> </Appenders>Loggers> |
Explanations:
- tbdSimilar to Controller Log4j configuration, see above.