Configuring Logging

Logging in the Solace .NET API does not have any external dependencies. The Solace .NET API supports logging levels in accordance with syslog (RFC 3164).

Supported Log Levels for .NET

  • Critical and Error: These log levels are reserved for internal errors and should be a cause for investigation. Contact Solace customer support for log events at this level.
  • Warn: Indicates an application error (for example, invalid parameters passed in or unsupported use of the APIs).
  • Notice: Reserved for unusual events that do not indicate any error, but they are unexpected and might need investigation.
  • Info: Typically used for state changes at a high level (for example, connect/disconnect/reconnect).
  • Debug: This log level is voluminous and typically requires Solace customer support to interpret.

When a log level is set at a given level, all log events with log level less severe than the selected level are filtered out; all log levels equally or more severe are included. For example, if the Error log filter level is selected, only Error and Critical events are included. In contrast, if Info log filter level is selected, Info, Notice, Warn, Error and Critical events are included, and the Debug level is filtered out.

Logging levels and a log event delegate can be set when the API is initialized.

To Set Up a Log Delegate

In the Solace .NET API, use the following property:

ContextFactoryProperties.LogDelegate

Related Samples

For an example of how to redirect Solace .NET API generated logs to stdout, see the RedirectLogs sample.

You can find this example on Solace Developers.