PostSharp 2023.0 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics.​Backends.​Log4Net Namespace / Log4Net­Collecting­Repository­Selector Class / Log4Net­Collecting­Repository­Selector Methods / Log4Net­Collecting­Repository­Selector.​Redirect­Logging­To­Post­Sharp Method

Log4NetCollectingRepositorySelector.RedirectLoggingToPostSharp Method

Sets the global RepositorySelector to a log4net-to-PostSharp redirector so that all repositories and loggers created after this call redirect all messages to PostSharp. Returns a "relay repository" which is the only repository that won't be redirected to PostSharp.

Namespace:  PostSharp.Patterns.Diagnostics.Backends.Log4Net
Assembly:  PostSharp.Patterns.Diagnostics.Backends.Log4Net (in PostSharp.Patterns.Diagnostics.Backends.Log4Net.dll) Version: 2023.0.3.0 (2023.0.3.0)
public static ILoggerRepository RedirectLoggingToPostSharp()

Return Value

Type: ILoggerRepository
The relay repository. You should configure this with appenders where you want the final log output to go, and pass this to Log4NetLoggingBackend so that logging done by PostSharp goes to your appenders.
See Also