<PackageReference Include="Serilog" Version="4.4.0-dev-02437" />

Serilog.Context.LogContext

public static class LogContext
Holds ambient properties that can be attached to log events. To configure, use the FromLogContext method.
public static ILogEventEnricher Clone()

Obtain an enricher that represents the current contents of the LogContext. This can be pushed back onto the context in a different location/thread when required.

public static IDisposable Push(ILogEventEnricher enricher)

Push an enricher onto the context, returning an IDisposable that must later be used to remove the property, along with any others that may have been pushed on top of it and not yet popped. The property must be popped from the same thread/logical call context.

public static IDisposable Push(ILogEventEnricher[] enrichers)

Push multiple enrichers onto the context, returning an IDisposable that must later be used to remove the property, along with any others that may have been pushed on top of it and not yet popped. The property must be popped from the same thread/logical call context.

public static IDisposable Push(ReadOnlySpan<ILogEventEnricher> enrichers)

Push multiple enrichers onto the context, returning an IDisposable that must later be used to remove the property, along with any others that may have been pushed on top of it and not yet popped. The property must be popped from the same thread/logical call context.

public static IDisposable Push(IEnumerable<ILogEventEnricher> enrichers)

Push multiple enrichers onto the context, returning an IDisposable that must later be used to remove the property, along with any others that may have been pushed on top of it and not yet popped. The property must be popped from the same thread/logical call context.

public static IDisposable PushProperty(string name, object value, bool destructureObjects = false)

Push a property onto the context, returning an IDisposable that must later be used to remove the property, along with any others that may have been pushed on top of it and not yet popped. The property must be popped from the same thread/logical call context.

public static void Reset()

Remove all enrichers from LogContext for the current async scope.

public static IDisposable Suspend()

Remove all enrichers from the LogContext, returning an IDisposable that must later be used to restore enrichers that were on the stack before Suspend was called.