public static IAppender CreateAdoNetAppender(string name, string connectionString, string spocName, IFilter levelFilter) { var adoNetAppender = new AdoNetAppender() { Name = name, BufferSize = 1, ConnectionType = "System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", ConnectionString = connectionString, CommandType = CommandType.StoredProcedure, CommandText = spocName, UseTransactions = false }; //-- Create parameters adoNetAppender.AddParameter(CreateParameter("@DateCreated", DbType.DateTime, null)); adoNetAppender.AddParameter(CreateParameter("@Application", DbType.String, new PatternLayout(_applicationName), 250)); adoNetAppender.AddParameter(CreateParameter("@Level", DbType.String, new PatternLayout("%p"))); adoNetAppender.AddParameter(CreateParameter("@Class", DbType.String, new PatternLayout("%c"), 250)); adoNetAppender.AddParameter(CreateParameter("@Thread", DbType.Int32, new PatternLayout("%t"))); adoNetAppender.AddParameter(CreateParameter("@Message", DbType.String, new PatternLayout("%m"), 8000)); adoNetAppender.AddParameter(CreateParameter("@Exception", DbType.String, new PatternLayout("%exception"), 8000)); adoNetAppender.AddParameter(CreateParameter("@Operation", DbType.String, new PatternLayout("InsertError"), 150)); adoNetAppender.AddFilter(levelFilter); adoNetAppender.ActivateOptions(); return(adoNetAppender); }