Controller.SysLog

The SysLog (System Logging Protocol) function enables the controller to log its important activities in local log files and optionally send them to a central SysLog server via a SysLog protocol. This enables the end user to monitor their infrastructure. This functionality is available from firmware version 1.13.0 on.

A screenshot of a computer

Description automatically generated with medium confidence

Activity Diagram

  1. Activate and parameterize the SysLog Client

  2. Prepare the controller to access the local logfiles

  3. Get local logfiles

  4. Get logfiles from SysLog Server

  • In the event of a power failure, the local log file messages and messages sent via the syslog client are not guaranteed. Messages may not be saved or transmitted. One solution could be to use a UPS.

Activate and parameterize the SysLog Client

The function can be parameterized using the following parameters. Please note that these parameters must be saved persistently in the parameter set and the controller must be restarted for the parameters to become valid.

Activate SysLog Client

The controller has two logging options:

  • Internal logging into local log files

  • Sending of logging messages via the SysLog protocol to a SysLog Server

The local logging is always active, but the sending of logging messages can be activated with the following parameter.

Parameter for SysLog Client activation

Address

Name

Info

0x5914:001

 

 

SysLog Client: SysLogClient activation

SysLog Client activation

enum 0

Deactivated (default)

SysLog Client is deactivated

enum 1

Activated

SysLog Client is activated

SysLog Server IP address.

This is the IP v4 address of the SysLog Server.

Parameter for SysLog Server IP address

Address

Name

Info

0x5914:002

SysLog Client: IP address of SysLog Server

UDINT 4 bytes

0.0.0.0 (default) –255.255.255.255

IP address of SysLog Server

SysLog Server Port

This is the parameter for the port of the SysLog Server. This setting is independent of whether a protocol udp or tcp is selected.

Parameter for SysLog Server Port

Address

Name

Info

0x5914:003

SysLog Client: Port of SysLog Server

UDINT 2 bytes

0 – 514 (default) - 65535

Port of SysLog Server

  • Due to blocked outgoing TCP sockets in the Linux environment, ports up to 1000 cannot be used for TCP. A port greater than 1000 must therefore be selected to send TCP Messages.

SysLog Protocol Type

This is the parameter for the protocol of the SysLog Messages.

Parameter for SysLog Protocol Type

Address

Name

Info

0x5914:004

SysLog Client: SysLog ProtocolType

SysLog Client Protocol Type

enum 0

UDP (default)

SysLog Messages via UDP

enum 1

TCP

SysLog Messages via TCP

SysLog Message Encryption

This is the parameters for setting the optional encryption of the SysLog Messages.

Parameter for encryption of the SysLog messages

Address

Name

Info

0x5914:005

SysLog Client: SysLog Message Encryption

SysLog Message Encryption

enum 0

not encrypted SysLog protocol

Cleartext Messages via SysLog

enum 1

with TLS encrypted SysLog protocol

TLS Encrypted SysLog Messages

SysLog Message Severity Filter

These are the parameters for filtering the SysLog Messages via Severity.

Parameter for filtering the SysLog severities

Address

Name

Info

0x5914:006

 

 

 

 

 

 

 

 

SysLog Client: Message Severities

Filter for SysLog Message Severities

bit 0

emerg (default = activated)

Severity Emergencies “System unusable”

bit 1

alert (default = activated)

Severity Alerts “Immediate action needed”

bit 2

crit (default = activated)

Severity Severity Critical “Critical conditions”

bit 3

err (default = activated)

Severity Severity Error “Error conditions”

bit 4

warning (default = deactivated)

Severity Warning “Warning conditions”

bit 5

notice (default = deactivated)

Severity Notification “Normal but significant condition”

bit 6

info (default = deactivated)

Severity Information “Informational messages only”

bit 7

debug (default = deactivated)

Severity Debugguing “Debugging messages”

  • The parameter 0x5914:006 for filtering the Severities is working for the SysLog-Client functionality and the local logfiles on the controller. The filter works on local log files even if the SysLog Client is deactivated.

These parameters can be modified for example via the parameter list or the user dialog via Settings \ Communication \ System Logging Protocol (SysLog).

A screenshot of a computer

Description automatically generated with medium confidence

Settings Dialog

Certificate Handling for encrypted SysLog

If the user wants to secure remote logging on syslog servers, the user can activate encrypting the protocol with TLS.

  • The encrypted SysLog protocol is only specified for the TCP connection and not for UCP connections. Therefore, if the user has activated the UDP SysLog Protocol Type (0x5914:004), and the user switches from unencrypted to TLS encrypted (0x5914:005), the Protocol Type will automatically switch to TCP.

When setting the encrypted SysLog protocol with parameter 0x5914:005, a certificate is needed for the encryption. The user can handle this certificate via the Security Screen of the PLC Designer via the menu View / Security Screen. When choosing the Device tab and the Device itself, the actual certificates are shown after `Refresh the list of available devices and their certificate stores`.

A screenshot of a computer

Description automatically generated with medium confidence

Certificate for SysLog

The user can use the auto-generated certificate for `Lenze Syslog Proxy`, or delete this and create a new one. The user can also upload this certificate to the user computer or show the details.

Details of this automatically generated certificate can be found in the chapter Controller - Security data, (refer to Controller.SysLog.Certificate)

  • A certificate is mandatory for a secure SysLog connection. If the user manually deletes the SysLog Proxy Certificate during operation, the SysLog Client of the controller will send information about missing certificates to the SysLog Server. Therefore the Client will user the `deleted` certificate until rebooting.

  • A certificate is mandatory for a secure SysLog connection. If the user manually generate a new SysLog Proxy Certificate during operation, the SysLog Client will terminate the TLS connection based on the old certificate and will start a new TLS connection based on the new certificate.

  • If the SysLog connection is used in an encrypted manner and the certificate expires during operation, communication continues based on the then invalid certificate. If the controller is restarted, a new valid certificate is automatically generated and the SysLog connection is opened based on the new valid certificate.

Behavior when SysLog Proxy Certificate is deleted after different reset levels

Reset Level

Behavior

Manually stop and start the application

The SysLog Proxy Certificate is still deleted.

Reset Warm

The SysLog Proxy Certificate is still deleted.

Reset Cold

The SysLog Proxy Certificate is still deleted.

Reset Origin and create the application again

The SysLog Proxy Certificate is still deleted.

Boot the Controller

The SysLog Proxy Certificate is automatically generated new.

File Monitoring

In addition to the SysLog, a file monitoring was initialized to log information about configuration changes.

  • This file monitoring is only available at runtime, i.e. changes to the file system when the system is turned off are not logged. The SD card must therefore be protected against unauthorized removal and modification.

  • The focus of this file monitoring is on static files that change frequently during commissioning, but should not or rarely change during machine runtime

    (Controller.SysLog:MonitoredFilesAndDirectories). The focus is not on files that are subject to permanent change, e.g. an application logbook.

The type of monitoring and the response in the log lines can be seen in the following two tables.

Monitoring of Files

File Monitoring

Example Log Line

(Log lines may vary depending on the tool used)

Create file if it does not exists

/<path>/<file>: CREATE

/<path>/<file>: CLOSE_WRITE

Delete existing file

/<path>/<file>: DELETE

Change and safe content of existing file

/<path>/<file>: CLOSE_WRITE

Change rights of existing file

/<path>/<file>: ATTRIB

Monitoring of Directories

Directory Monitoring

Example Log Line

(Log lines may vary depending on the tool used)

Rename existing file in directory

/<path>/<oldfile>: MOVED_FROM

Change content of existing file in directory

/<path>/<file>: CLOSE_WRITE

Change rights of existing file in directory

/<path>/<file>: ATTRIB

Delete existing file in directory

/<path>/<file>: DELETE

  • This file and directory monitoring procedure cannot process files or directories with the special character “;” (semicolon). The Lenze Tools do not create files or directories with this character. This means that the user may not use customized files or directories with this special character.

    If a file or directory with this special character exists and this file or directory is being monitored, the application will not start for security reasons.

Application Logging via FB AddSysLog

Please refer to chapter SysLog to get more information about this function block.

Behavior in case of SysLog processing failures

Behavior in case of SysLog processing failures

The Controller uses the SysLog service for generating and storing security-relevant audit messages.

During Controller startup, the availability of the required SysLog functionality is part of the startup dependencies. If the required SysLog functionality cannot be started successfully, the Controller startup is aborted. This prevents the Controller from entering normal operation without the required audit logging functionality.

If the SysLog service stops unexpectedly during Controller runtime, the essential and prioritized Controller functions continue to operate and are not affected by the failure of the audit logging functionality. In particular, failure of the SysLog service does not automatically stop the running Controller application or the essential control functions.

Currently, no separate active user notification is generated if the SysLog service stops unexpectedly during runtime. The failure can be detected indirectly by the user or an external monitoring system through the absence of expected SysLog messages.

For applicable Reaction Manager events, if the SysLog sink is temporarily unavailable, messages can be stored in the local Reaction Manager outbox for later replay when the SysLog sink becomes available again. This fallback mechanism does not guarantee preservation of messages under all combined failure conditions.