public void SetUp() { fileGuid = Guid.NewGuid(); if (File.Exists(GetFilePath())) { File.Delete(GetFilePath()); } appender = new AsyncRollingFileAppender(); appender.Threshold = ErrorLevel; appender.File = GetFilePath(); appender.Layout = new PatternLayout("%d|%-5level|%logger| %message %exception%n"); appender.StaticLogFileName = true; appender.AppendToFile = true; appender.ActivateOptions(); rep = LogManager.CreateRepository(Guid.NewGuid().ToString()); BasicConfigurator.Configure(rep, appender); }