Skip to content

Instantly share code, notes, and snippets.

@jbrechtel
Created May 3, 2009 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbrechtel/106143 to your computer and use it in GitHub Desktop.
Save jbrechtel/106143 to your computer and use it in GitHub Desktop.
using Elmah;
using System.Collections;
namespace ElmahTest
{
public class CustomSQLLog : Elmah.ErrorLog
{
private readonly SqlErrorLog errorLog;
public CustomSQLLog(IDictionary config) : this()
{
}
public CustomSQLLog()
{
string connStr = "server=(local)\\sqlexpress;trusted_Connection=true;database=elmah";
errorLog = new SqlErrorLog(connStr);
}
public override Elmah.ErrorLogEntry GetError(string id)
{
return errorLog.GetError(id);
}
public override int GetErrors(int pageIndex, int pageSize, System.Collections.IList errorEntryList)
{
return errorLog.GetErrors(pageIndex, pageSize, errorEntryList);
}
public override string Log(Elmah.Error error)
{
return errorLog.Log(error);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment