Table of Contents

Class RequestLoggingOptions

Namespace
Excalibur.Data.ElasticSearch.Monitoring
Assembly
Excalibur.Data.ElasticSearch.dll

Configures request and response logging for Elasticsearch operations.

public sealed class RequestLoggingOptions
Inheritance
RequestLoggingOptions
Inherited Members

Properties

AllowedBodyProperties

Gets the body property names whose values may be written to the log verbatim.

public ISet<string> AllowedBodyProperties { get; init; }

Property Value

ISet<string>

The set of property names treated as safe to record. Empty by default, which redacts every body value. Names are matched without regard to case.

Remarks

This is an allow list, not a deny list: a property that does not appear here is redacted, so a field nobody anticipated is withheld rather than recorded. Naming a property here opts its value out of redaction wherever it occurs in the body, including nested objects and arrays, so name only properties that carry no personal data, credentials, or other sensitive content.

Property names are preserved even when their values are redacted, because a log stripped of structure is of little diagnostic use. A body whose property names are themselves sensitive - a map keyed by email address, for example - is therefore not a candidate for body logging at all.

A body that is not well-formed JSON cannot be redacted one value at a time and is withheld in full.

Enabled

Gets a value indicating whether request/response logging is enabled.

public bool Enabled { get; init; }

Property Value

bool

A bool indicating whether to log requests and responses. Defaults to false .

LogFailuresOnly

Gets a value indicating whether to log only failed requests.

public bool LogFailuresOnly { get; init; }

Property Value

bool

A bool indicating whether to log only failed operations. Defaults to true .

LogRequestBody

Gets a value indicating whether to log request bodies.

public bool LogRequestBody { get; init; }

Property Value

bool

A bool indicating whether to include request body content. Defaults to false .

Remarks

Body values are redacted unless their property name appears in AllowedBodyProperties, so enabling this without an allow list records the shape of each body and none of its content.

LogResponseBody

Gets a value indicating whether to log response bodies.

public bool LogResponseBody { get; init; }

Property Value

bool

A bool indicating whether to include response body content. Defaults to false .

Remarks

Body values are redacted unless their property name appears in AllowedBodyProperties, so enabling this without an allow list records the shape of each body and none of its content.

LogTransportDebugInformation

Gets a value indicating whether to log the transport layer's diagnostic dump for failed operations.

public bool LogTransportDebugInformation { get; init; }

Property Value

bool

A bool indicating whether to include transport debug information. Defaults to false .

Remarks

The transport composes this text itself and it commonly embeds the full request and response bodies. It cannot be redacted structurally and AllowedBodyProperties does not apply to it, so enabling this records request and response content in the clear. Failures are already logged with their status code, request URI, and error reason without it.

MaxBodySizeBytes

Gets the maximum body size to log in bytes.

public int MaxBodySizeBytes { get; init; }

Property Value

int

The maximum size of request/response bodies to log. Defaults to 1024 bytes.

Remarks

The limit applies to the redacted body, so it bounds what actually reaches the log. It must be greater than zero; to record no body content, leave LogRequestBody and LogResponseBody off rather than setting a size of zero.