MongoDB provider for Elmah
C#
Pull request Compare This branch is 16 commits ahead, 17 commits behind CaptainCodeman:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
build
nuget
packages
src
.gitignore
readme.markdown

readme.markdown

Elmah-MongoDB

See: Elmah Error Logging with MongoDB Official Driver

Overview

ELMAH (Error Logging Modules and Handlers) is an application-wide error logging facility that is completely pluggable. It can be dynamically added to a running ASP.NET web application, or even all ASP.NET web applications on a machine, without any need for re-compilation or re-deployment.

This provider enables MongoDB to be used as the back-end storage via the Official 10gen provider.

Usage

The easiest way to add this to a project is via the elmah.mongodb NuGET package which will add the required assemblies to your project.

The provider supports multiple per-application collections within a single database and will automatically create a MongoDB Capped Collection called 'Elmah' if the application name is not set or will use Elmah-ApplicationName if it is.

The size of the MongoDB collection can be controlled by setting the maxSize (bytes) and maxDocuments properties. By default a 100mb collection is used (with no document limit).

Configuration

Here is an example configuration:

<elmah>
  <errorLog type="Elmah.MongoErrorLog, Elmah.MongoDB" connectionStringName="elmah-mongodb" maxSize="10485760" maxDocuments="10000"/>
</elmah>
<connectionStrings>
  <add name="elmah-mongodb" connectionString="server=localhost;database=elmah;"/>
</connectionStrings>