Info
Version: | 1.0.3 |
Author(s): | Azhar Iqbal |
Last Update: | Tuesday, August 25, 2015 |
.NET Fiddle: | Create the first Fiddle |
NuGet Url: | https://www.nuget.org/packages/ForwardMongoLogger |
Install
Install-Package ForwardMongoLogger
dotnet add package ForwardMongoLogger
paket add ForwardMongoLogger
ForwardMongoLogger Download (Unzip the "nupkg" after downloading)
Dependencies
- log4net(2.0.3)
- MongoDB.Driver(2.0.1)
Tags
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<log4net>
<!--MongoDbAppender-->
<appender name="UepMongoLogAppender" type="ForwardMongoLogger.MongoDbAppender, ForwardMongoLogger">
<!--Mention connection string of your mongoDb, If you will not specify any db name, a default database will be created wit the name "MongoLog"-->
<connectionString value="mongodb://localhost/forwardTestLog"/>
<!--Specify the collection name in mongoDb, in case of absence, default collection name would be "logs" -->
<collectionName value="logs"/>
<!--1.if you are creating a brand new collection, by mentioning this flag true you will have a cappedCollecton created in your db.
2.if you have an existing collection( which is not capped) by mentionting this flag true, your existing collection will be converted to cappedCollection.Please consider
this operation may take long to complete, totally depends upon your existing collection documents size -->
<cappedCollection value="true"/>
<!-- mention size in bytes for capped collection on file system, when your collection size will reach the thrashold it start overwriting
default size for capped collection is 4096 bytes-->
<cappedCollectionSize value="1000000"/>
<!-- you can also specify maximam number of documents instead collection max size.
In case collection documents count will reach to the max documents, it starts overwriting
default max document size for capped collection is 2000 documents -->
<maxNumberOfDocuments value="5000"/>
<!-- you can add/delete field as suites to your project need -->
<field>
<name value="timestamp"/>
<layout type="log4net.Layout.RawTimeStampLayout"/>
</field>
<field>
<name value="level"/>.