public void TestFixtureSetUp() { appender = new AsyncAdoAppender { CommandType = CommandType.Text, ConnectionString = connectionString, CommandText = commandText, ConnectionType = connectionType }; appender.AddParameter(new AdoNetAppenderParameter { DbType = DbType.DateTime, ParameterName = "@log_date", Layout = new RawUtcTimeStampLayout() }); appender.AddParameter(new AdoNetAppenderParameter { DbType = DbType.String, Size = 255, ParameterName = "@thread", Layout = new Layout2RawLayoutAdapter(new PatternLayout("%thread")) }); appender.AddParameter(new AdoNetAppenderParameter { DbType = DbType.String, Size = 40, ParameterName = "@log_level", Layout = new Layout2RawLayoutAdapter(new PatternLayout("%level")) }); appender.AddParameter(new AdoNetAppenderParameter { DbType = DbType.String, Size = 255, ParameterName = "@logger", Layout = new Layout2RawLayoutAdapter(new PatternLayout("%logger")) }); appender.AddParameter(new AdoNetAppenderParameter { DbType = DbType.String, Size = 4000, ParameterName = "@message", Layout = new Layout2RawLayoutAdapter(new PatternLayout("%message")) }); appender.AddParameter(new AdoNetAppenderParameter { DbType = DbType.String, Size = 4000, ParameterName = "@exception", Layout = new Layout2RawLayoutAdapter(new PatternLayout("%exception")) }); appender.AddParameter(new AdoNetAppenderParameter { DbType = DbType.String, Size = 200, ParameterName = "@application", Layout = new Layout2RawLayoutAdapter(new PatternLayout(ApplicationName)) }); appender.Threshold = ErrorLevel; appender.BufferSize = -1; appender.ActivateOptions(); rep = LogManager.CreateRepository(Guid.NewGuid().ToString()); BasicConfigurator.Configure(rep, appender); LogsDBAccess.RemoveMatchingLogEntries(ErrorLevel, ErrorMessage, ApplicationName); }
public void TestFixtureTearDown() { LogsDBAccess.RemoveMatchingLogEntries(ErrorLevel, ErrorMessage, ApplicationName); rep.Shutdown(); }