PostSharpAPI ReferencePost­Sharp.​Patterns.​Diagnostics.​Backends.​Log4NetLog4Net­Collecting­Repository­SelectorRedirect­Logging­To­Post­Sharp
Open sandboxFocus

Log4NetCollectingRepositorySelector.RedirectLoggingToPostSharp Method

RedirectLoggingToPostSharp()

Sets the global log4net.Core.LoggerManager.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.

Declaration
public static ILoggerRepository RedirectLoggingToPostSharp()
Returns
Type Description
log4net.Repository.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.