A persistence provider for Elmah using the Shaolinq library.
Install the Elmah.Shaolinq package from Nuget.
Adjust your DataAccessModel class to implement IElmahDataAccessModel:
[DataAccessModel]
public abstract class MyDataAccessModel
: DataAccessModel, IElmahDataAccessModel
{
// ...other fields
[DataAccessObjects]
public abstract DataAccessObjects<DbElmahError> ElmahErrors { get; }
}In your web.config, configure the Elmah error logger:
<elmah>
<errorLog type="Elmah.Shaolinq.ShaolinqErrorLog, Elmah.Shaolinq"
dataAccessModelType="MyAssembly.MyDataAccessModel, MyAssembly"
dataAccessModelConfigSection="MyDataAccessModel" />
</elmah>The dataAccessModelConfigSection attribute is optional, defaulting to the name of the DataAccessModel type if not specified.
Elmah.Shaolinq supports per-application isolation - by default only errors for the application in which Elmah is running will be returned. If you want to return errors for a different application, set the applicationName attribute to the name of the application required, or to * to disable per-application isolation.