Skip to content

AGiorgetti/elmah-mongodb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elmah-MongoDB

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 .NET/C# 2.0 Driver.

Usage

The easiest way to add this to a project is via the Elmah.MongoDB.Driver 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="mongodb://localhost/elmah"/>
</connectionStrings>