SAS® Event Stream Processing (ESP) server logging uses the loglevel parameter to enable logging contexts. The ESP server also accepts a logging configuration file specified using the logconfig parameter to enable additional logging features.
The ESP server provides the following logging contexts, which can be specified using the loglevel parameter.
Logging Context | Description |
---|---|
esp |
Represents the basic engine and generates messages about events that flow through the system, throttling, system errors, and so on. |
common.http | Details HTTP requests that come into the server and their corresponding responses. |
common.smtp | Details SMTP server interaction in notification windows. |
esp.http | Details event-stream-processing specific HTTP requests. |
esp.pubsub | Details event-stream-processing publish/subscribe activity. |
esp.router | Provides logging for ESP router instances. |
esp.server | Provides information about general ESP server issues. |
esp.windows | Provides information about window issues. |
event.generator | Provides event-generator logging. |
pubsub.http | Details requests and responses from the publish/subscribe HTTP server. |
window.functional | Provides functional window logging. |
window.notification | Shows messages specific to notification windows. |
To set the start-up log level for the ESP server, use the loglevel parameter on the command line, as shown in the following example:
This parameter sets the log level for each specified context before the server starts to perform its basic functions.
By default, the ESP server writes logging messages to the local terminal screen (standard output).
The ESP server can use a SAS logging configuration file, specified using the logconfig
parameter. The logconfig
parameter accepts a logging configuration file that can enable additional logging features. The logging configuration file can configure the output to go to a rolling log file appender instead of the local terminal screen. Other SAS loggers can be configured for additional debugging information. An example logging configuration file, esp-logger, is shipped in the configuration directory.
The default location for configuration files is /opt/sas/viya/config/etc/SASEventStreamProcessingEngine/default under Linux and \SAS\Viya\SASEventStreamProcessingEngine\default under Windows. In Windows operating environments, if the PUBLIC environment variable is defined, it is placed at the beginning of the configuration directory path, before \SAS\.
The example logging configuration file esp-logger directs log messages to the local terminal. To use a rolling file appender instead, follow these steps:
Choose one of the fileNamePattern options, based on the operating system (Linux or Windows) that you are using. Comment out the fileNamePattern for the operating system that you are not using. The ESP server must have permission to write to the directory specified as the value of the fileNamePattern.
At the bottom of the file, update the root logger to use the timeBasedRollingFileAppender:
Start the ESP server with the logconfig parameter:
After you start the ESP server, you can find the log file in the path specified with the fileNamePattern param.
You cannot specify the ESP server logging contexts, except for the esp logging context, in the logging configuration file specified using the logconfig parameter. You should specify the ESP server logging contexts using the -loglevel
parameter. When you use both loglevel
and logconfig parameters, the logging context values specified on the loglevel parameter are sent to the appender configured for the root logger.
Note: The esp logging context is equivalent to the DF.ESP logger. The esp logger level specified using the loglevel parameter overrides the DF.ESP logger configured in the logging configuration file specified using the logconfig parameter.
For example, to configure the common.http logging context to trace and have the output sent to a rolling file appender, as configured above, start the ESP server using the following command:
Product Family | Product | System | Product Release | SAS Release | ||
Reported | Fixed* | Reported | Fixed* | |||
SAS System | SAS Event Stream Processing Engine | Microsoft® Windows® for x64 | 4.3 | |||
Linux for x64 | 4.3 |
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://www.sas.com/xml/logging/1.0/">
<appender class="RollingFileAppender" name="timeBasedRollingFileAppender">
<param name="Append" value="true"/>
<param name="ImmediateFlush" value="true"/>
<rollingPolicy class="TimeBasedRollingPolicy">
<param name="fileNamePattern" value="/opt/sas/viya/config/var/log/SASEventStreamProcessingEngine/esp-%S{jobid}-%d{yyyy-MM-dd}.log" />
</rollingPolicy>
<layout>
<param name="HeaderPattern"
value="Host: '%S{hostname}', Process: '%S{pid}', OS: '%S{os_bits} %S{os_family}', OS Release: '%S{os_release}'"/>
<param name="ConversionPattern"
value="%d; %-5p; %t; %c; (%F:%L); %m"/>
</layout>
</appender>
<!--
logger for main ESP runtime (c++ library/pubsub)
-->
<logger name="DF.ESP">
<!--
esp default log level is info
-->
<level value="info" />
</logger>
<!--
logger for streaming analytics algortihms
-->
<logger name="DF.ESP.SA">
<level value="info" />
</logger>
<!--
logger for Micro Analytic Service runtime
-->
<logger name="App.tk.MAS">
<level value="error" />
</logger>
<!--
logger for Micro Analytic Service code generation
-->
<logger name="App.tk.MAS.CodeGen">
<level value="fatal" />
</logger>
<!--
logger for Micro Analytic Service Python support
-->
<logger name="App.tk.MAS.Python">
<level value="error" />
</logger>
<!--
Root logger
-->
<root>
<level value="info"/>
<appender-ref ref="timeBasedRollingFileAppender"/>
</root>
</configuration>
Type: | Usage Note |
Priority: |
Date Modified: | 2017-07-21 10:39:59 |
Date Created: | 2017-06-07 11:19:19 |