PostSharp6.0/API Reference/Post­Sharp.​Patterns.​Diagnostics Namespace/Logging­Backend Class/Logging­Backend Methods/Logging­Backend.​Open­Custom­Activity­Context Method

LoggingBackend.OpenCustomActivityContext Method

Gets a LoggingContext for a custom activity (opened using OpenActivity(String) or OpenAsyncActivity(String)).

Namespace:  PostSharp.Patterns.Diagnostics
Assembly:  PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 6.0.35.0 (6.0.35.0)
Syntax
C#
public LoggingContext OpenCustomActivityContext(
	LoggingTypeSource type,
	LogActivityOptions options
)

Parameters

type
Type: PostSharp.Patterns.Diagnostics.LoggingTypeSource
The type to which the activity belongs.
options
Type: PostSharp.Patterns.Diagnostics.LogActivityOptions
Options of the new activity.

Return Value

Type: LoggingContext
A SyncCustomActivityLoggingContext if options.IsAsync is false, otherwise an AsyncCustomActivityLoggingContext.
See Also