Logging

Micro-Integrations provide logging support through the logback logging framework, configured using Spring configuration properties. This framework provides advanced logging features such as auto rollover by size or date, archiving, log export to common logging services, and log levels.

Configuring Logback

If you require logback configuration beyond what is available using Spring configuration properties, you can run your Micro-Integration with a logback-spring.xml file. For information about using logback, see the following sections of the Spring documentation:

In addition to what Spring Boot provides, each Micro-Integration supplies its own alternative logback configuration files that you can include in your logback-spring.xml file.

You can include the following files (found at com/solace/connector/core/logging/logback/) in your logback-spring.xml file:

defaults.xml

The defaults.xml file provides conversion rules, pattern properties, and common logger configurations.

We recommend that you always include the defaults.xml file in your logback-spring.xml file because it includes a %sanitize <conversionRule> that applies to the default CONSOLE_LOG_PATTERN and FILE_LOG_PATTERN. This conversion rule does some filtering to obfuscate potentially sensitive data from the logs.

If your Micro-Integration supplies its own logback-spring.xml file that does not include defaults.xml, that file replaces the framework's logging configuration, including rate limiting, rather than extending it.

console-appender.xml
The console-appender.xml file adds a ConsoleAppender using the CONSOLE_LOG_PATTERN.
file-appender.xml
The file-appender.xml file adds a RollingFileAppender using the FILE_LOG_PATTERN and ROLLING_FILE_NAME_PATTERN with appropriate settings.

In addition to the files described in the preceding section, this Micro-Integration also supports the same logging options as Spring Boot.

For more information and examples, see the Configure Logback for Logging section of the Spring documentation.

Rate Limiting Repeated Log Events

The defaults.xml file also rate limits repeated log events to prevent log flooding, for example when event broker redeliveries of a poison message cause the Micro-Integration to log the same transformation error indefinitely. The Micro-Integration logs the first occurrence of a repeated event in full, including its stack trace. The Micro-Integration suppresses subsequent occurrences and periodically summarizes them with a line of the following form:

[rate-limited] 8412 occurrences of WARN events (exception com.example.SomeException, workflow 0) suppressed since last log; 8413 total since first seen

By default, the Micro-Integration rate limits only WARN and ERROR events, and emits at most one summary line per event group per interval (5 minutes by default). Suppression applies only while an event group keeps repeating: if an event group goes quiet, the Micro-Integration logs it in full again the next time it occurs.

The Micro-Integration reads the rate-limiting configuration at startup, so you must restart your Micro-Integration to pick up configuration changes. You can configure log rate limiting with the following properties:

Property Default Description

solace.connector.logging.rate-limit.enabled

true

Indicates whether the Micro-Integration applies rate limiting to repeated log events. Set to false to restore unfiltered logging.

solace.connector.logging.rate-limit.level

WARN

The lowest level at which the Micro-Integration applies rate limiting to log events. Events below this level always pass through unfiltered. Set to TRACE to rate limit every level, or to OFF to disable rate limiting entirely.

solace.connector.logging.rate-limit.count-threshold

0

The number of suppressed occurrences that triggers a summary line. The default of 0 disables this count trigger, leaving summaries to the time trigger only.

solace.connector.logging.rate-limit.interval-ms

300000

The time, in milliseconds, after which suppressed occurrences trigger a summary line.