<PackageReference Include="Serilog" Version="4.4.1-dev-02447" />

Serilog.Configuration.LoggerDestructuringConfiguration

Controls template parameter destructuring configuration.

Capture instances of the specified type as dictionaries. By default, only concrete instantiations of are considered dictionary-like.

public LoggerConfiguration AsScalar(Type scalarType)

Treat objects of the specified type as scalar values, i.e., don't break them down into properties even when destructuring complex types.

public LoggerConfiguration AsScalar<TScalar>()

Treat objects of the specified type as scalar values, i.e., don't break them down into properties even when destructuring complex types.

public LoggerConfiguration ByTransforming<TValue>(Func<TValue, object> transformation)

When destructuring objects, transform instances of the specified type with the provided function.

public LoggerConfiguration ByTransformingWhere<TValue>(Func<Type, bool> predicate, Func<TValue, object> transformation)

When destructuring objects, transform instances of the specified type with the provided function, if the predicate returns true. Be careful to avoid any intensive work in the predicate, as it can slow down the pipeline significantly.

public LoggerConfiguration ToMaximumCollectionCount(int maximumCollectionCount)

When destructuring objects, collections be restricted to specified count thus avoiding bloating payload. Limit is applied to each collection separately, sum of length of collection can exceed limit. Applies limit to all IEnumerable including dictionaries.

public LoggerConfiguration ToMaximumDepth(int maximumDestructuringDepth)

When destructuring objects, depth will be limited to 10 property traversals deep to guard against ballooning space when recursive/cyclic structures are accidentally passed. To change this limit pass a new maximum depth.

public LoggerConfiguration ToMaximumStringLength(int maximumStringLength)

When destructuring objects, string values can be restricted to specified length thus avoiding bloating payload. Limit is applied to each value separately, sum of length of strings can exceed limit.

public LoggerConfiguration With(IDestructuringPolicy[] destructuringPolicies)

When destructuring objects, transform instances with the provided policies.

public LoggerConfiguration With<TDestructuringPolicy>() where TDestructuringPolicy : IDestructuringPolicy

When destructuring objects, transform instances with the provided policy.