private void InjectInMemoryAppender(Level loggingLevel) { var appender = new InMemoryAppender(); var hierarchy = (Hierarchy)LogManager.GetRepository(); hierarchy.ResetConfiguration(); hierarchy.Root.AddAppender(appender); hierarchy.Root.Level = loggingLevel; appender.ActivateOptions(); hierarchy.Configured = true; }
private InMemoryAppender InjectInMemoryAppender() { var appender = new InMemoryAppender(); var hierarchy = (Hierarchy)LogManager.GetRepository(); hierarchy.ResetConfiguration(); hierarchy.Root.AddAppender(appender); hierarchy.Root.Level = Level.All; appender.ActivateOptions(); hierarchy.Configured = true; return(appender); }