ls-logo

Log4Net Notification Appender

knowventBanner

Log4Net is a great library to add an application specific logging quickly and easily. However, many times I hear “how do I setup my application to send notifications”. If you are already using Log4Net then this easy to use Log4Net notification appender is a must have.

Notifications and cloud logging using Log4Net is to setup

3 Easy Steps – Knowvent & Log4Net Notification Appender

1) Add the Nuget package to your project

PM> Install-Package Knowvent.Log4Net 

2) Setup your Appender configuration in the app.config/web.config

The nuget package will automatically add the Knowvent Appender to your configuration file upon install. All you need to do is supply a ClientId and ApiKey.

  <log4net>
    <root>
      <level value="ALL" />
      <appender-ref ref="KnowventAppender" />
    </root>
    <appender name="KnowventAppender" type="Knowvent.Log4Net.KnowventAppender, Knowvent.Log4Net">
      <ClientId>00000000-0000-0000-0000-000000000000</ClientId> <!--Required-->
      <ApiKey>xXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx</ApiKey> <!--Required-->
      <LoggingCode /> <!--Optional but recommended-->
      <ApplicationName /> <!--Optional. Will use Machine name if left empty -->
      <layout type="log4net.Layout.PatternLayout">
          <ConversionPattern value="%m" />
      </layout>
    </appender>
  </log4net>

If you don’t have a Knowvent Account, Signup for a free account an get your access illustrated below:

Knowvent Api Keys

3) Log Your First Event

log.Warn("Never miss an important issue again :-)");

With Knowvent you can get notified via SMS, Email and Mobile push notifications.

Knowvent handles events and notifications using a Pub-Sub model. If you would like to know how to customize your notification experience you can visit Knowvent’s Help Docs.


You can check out the Github project for more details or to report issues.

Let us know below how this helped you:

Posted in .NET, Knowvent, Programming and tagged , , , , .