PostSharp 6.9 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics.​Backends.​Serilog Namespace / Serilog­Logging­Backend Class

SerilogLoggingBackend Class

Logging back-end for Serilog.
Inheritance Hierarchy
System.Object
  PostSharp.Patterns.Diagnostics.LoggingBackend
    PostSharp.Patterns.Diagnostics.Backends.TextLoggingBackend
      PostSharp.Patterns.Diagnostics.Backends.Serilog.SerilogLoggingBackend

Namespace:  PostSharp.Patterns.Diagnostics.Backends.Serilog
Assembly:  PostSharp.Patterns.Diagnostics.Backends.Serilog (in PostSharp.Patterns.Diagnostics.Backends.Serilog.dll) Version: 6.9.11.0 (6.9.11.0)
Syntax
C#
public class SerilogLoggingBackend : TextLoggingBackend

The SerilogLoggingBackend type exposes the following members.

Constructors
  NameDescription
Public methodSerilogLoggingBackend()
Initializes a new SerilogLoggingBackend and uses the globally-shared ILogger.
Public methodSerilogLoggingBackend(ILogger)
Initializes a new SerilogLoggingBackend and specifies the target ILogger.
Properties
  NameDescription
Public propertyCurrentContext
Gets the current LoggingContext.
(Inherited from LoggingBackend.)
Public propertyCurrentContextLocalConfiguration
Gets the LoggingContextLocalConfiguration for the current execution. Returns DefaultContextLocalConfiguration unless the context has been overwritten by WithContextLocalConfiguration(LoggingContextLocalConfiguration).
(Inherited from LoggingBackend.)
Public propertyDefaultContextLocalConfiguration
Gets the default LoggingContextLocalConfiguration, used unless it has been overwritten by the WithContextLocalConfiguration(LoggingContextLocalConfiguration) for the current execution context.
(Inherited from LoggingBackend.)
Public propertyDefaultVerbosity (Inherited from LoggingBackend.)
Public propertyIsCorrupted
Determines whether the current LoggingBackend is in a state where it can no longer be recovered. This typically happens when an exception occurs while disabling or enabling.
(Inherited from LoggingBackend.)
Public propertyIsDisposed
Determines whether the current LoggingBackend has been disposed.
(Inherited from LoggingBackend.)
Public propertyIsEnabled
Determines whether the current LoggingBackend is currently enabled. This property has precedence over, and does not affect, the minimal log levels set through the SetLevel(LogLevel) method.
(Inherited from LoggingBackend.)
Public propertyLogger
Gets the ILogger passed to the constructor of the current SerilogLoggingBackend, or the globally-shared ILogger if no logger was passed during the instantiation of the current SerilogLoggingBackend.
Public propertyMessageTemplateCacheSize
Gets the number of items in the message template cache.
Public propertyOptions
Gets the back-end options.
Public propertyTransactionPolicySelector
Gets or sets the selector that determines what policy to apply for each transaction or whether the transaction should be logged as a transaction at all.
(Inherited from LoggingBackend.)
Methods
  NameDescription
Public methodClearMessageTemplateCache
Clears the message template cache.
Protected methodCreateAsyncCustomActivityContext (Overrides LoggingBackend.CreateAsyncCustomActivityContext().)
Protected methodCreateAsyncMethodContext
Creates a new AsyncMethodLoggingContext for a given async method.
(Overrides LoggingBackend.CreateAsyncMethodContext().)
Protected methodCreateContextLocalConfiguration (Inherited from LoggingBackend.)
Protected methodCreateEphemeralContext
Creates a new EphemeralLoggingContext.
(Overrides LoggingBackend.CreateEphemeralContext(ThreadLoggingContext).)
Protected methodCreateExecutionContextData
Creates a new empty instance of ExecutionContextData possibly of a subclass which can hold backend-specific data.
(Inherited from LoggingBackend.)
Protected methodCreateIteratorContext
Creates a new IteratorLoggingContext for a given iterator method.
(Overrides LoggingBackend.CreateIteratorContext().)
Public methodCreateRecordBuilder
Creates a new LogRecordBuilder.
(Overrides LoggingBackend.CreateRecordBuilder().)
Protected methodCreateSyncCustomActivityContext (Overrides LoggingBackend.CreateSyncCustomActivityContext(ThreadLoggingContext).)
Protected methodCreateSyncMethodContext
Creates a new SyncMethodLoggingContext for a given normal (non-async, non-iterator) method.
(Overrides LoggingBackend.CreateSyncMethodContext(ThreadLoggingContext).)
Protected methodCreateThreadContext
Creates a new ThreadLoggingContext.
(Inherited from LoggingBackend.)
Public methodCreateTransaction
Creates a LoggingTransaction instance.
(Inherited from LoggingBackend.)
Protected methodCreateTypeSource
Creates a LoggingTypeSource for the given role and type.
(Overrides LoggingBackend.CreateTypeSource(LoggingNamespaceSource, Type).)
Protected methodCreateTypeSourceBySourceName
Creates a LoggingTypeSource for the given role and logger name.
(Overrides LoggingBackend.CreateTypeSourceBySourceName(LoggingNamespaceSource, String).)
Public methodCreateVerbosityConfiguration
Creates a new LoggingVerbosityConfiguration for the current LoggingBackend.
(Inherited from LoggingBackend.)
Public methodDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from LoggingBackend.)
Protected methodDispose(Boolean)
Disposes the current object.
(Inherited from TextLoggingBackend.)
Public methodGetAsyncContextOfTask
Gets the AsyncMethodLoggingContext associated with a Task.
(Inherited from LoggingBackend.)
Protected methodGetBackendOptions
Gets the formatting and rendering options for the current LoggingBackend.
(Inherited from TextLoggingBackend.)
Public methodGetSource(String, String) Obsolete.
Returns a LoggingNamespaceSource for the given role and, optionally, namespace.
(Inherited from LoggingBackend.)
Public methodGetSource(String, Type) Obsolete.
Returns a LoggingTypeSource for the given role and type.
(Inherited from LoggingBackend.)
Protected methodGetTextBackendOptions
Gets the options.
(Overrides TextLoggingBackend.GetTextBackendOptions().)
Public methodGetThreadContext
Returns the ThreadLoggingContext for the current Thread.
(Inherited from LoggingBackend.)
Public methodOpenAsyncContext
Gets an AsyncMethodLoggingContext for a given async method.
(Inherited from LoggingBackend.)
Public methodOpenEphemeralContext(LogMemberInfo)
Gets an EphemeralLoggingContext for use in a given method. An EphemeralLoggingContext is a degenerated kind of context, used to emit a single record.
(Inherited from LoggingBackend.)
Public methodOpenEphemeralContext(LoggingTypeSource, ThreadLoggingContext)
Gets an EphemeralLoggingContext for use in a given LoggingTypeSource. An EphemeralLoggingContext is a degenerated kind of context, used to emit a single record.
(Inherited from LoggingBackend.)
Public methodOpenIteratorContext
Gets an IteratorLoggingContext for a given iterator method.
(Inherited from LoggingBackend.)
Public methodOpenSyncContext
Gets a SyncMethodLoggingContext for a given normal (non-async, non-iterator) method.
(Inherited from LoggingBackend.)
Public methodToString
Returns a string that represents the current object.
(Inherited from LoggingBackend.)
Protected methodWithContextLocalConfiguration
Changes the LoggingContextLocalConfiguration for the current execution context.
(Inherited from LoggingBackend.)
Public methodWithVerbosityConfiguration
Changes the verbosity for the current execution context.
(Inherited from LoggingBackend.)
Extension Methods
  NameDescription
Public Extension MethodConfigureFromXml(XDocument, Boolean)Overloaded.
Configures a LoggingBackend from an XDocument.
(Defined by LoggingConfigurationManager.)
Public Extension MethodConfigureFromXml(XElement, Boolean)Overloaded.
Configures a LoggingBackend from an XElement.
(Defined by LoggingConfigurationManager.)
Public Extension MethodConfigureFromXmlAsync
Configures a LoggingBackend from an XML configuration file whose location is specified in a Uri.
(Defined by LoggingConfigurationManager.)
Public Extension MethodConfigureFromXmlWithAutoReloadAsync
Configures a LoggingBackend from an XML configuration file whose location is specified in a Uri and specifies a TimeSpan at which the file should be refreshed from source.
(Defined by LoggingConfigurationManager.)
Public Extension MethodResetConfiguration
Removes the TransactionPolicySelector and resets the DefaultVerbosity of a given LoggingBackend.
(Defined by LoggingConfigurationManager.)
Public Extension MethodStopAutoReloadConfigurationAsync
Stops all auto-refresh configuration set up by ConfigureFromXmlWithAutoReloadAsync(LoggingBackend, Uri, TimeSpan, CancellationToken) and waits until all pending operations have completed.
(Defined by LoggingConfigurationManager.)
See Also