Giter Site home page Giter Site logo

glimpse.log4net's Introduction

A plugin to display log4net log messages in Glimpse.

Getting Started

In order to begin using the Glimpse.Log4Net (GL4N) plugin, add a reference to the plugin assembly (Glimpse.Log4Net.dll) to your web project, or simply drop the assembly in your /bin folder.

Alternatively, add the reference via NuGet: Install-Package Glimpse.Log4Net

Basic Configuration

Unless you manually configure a GL4N appender, GL4N will automatically attach one to log4net's Root appender for you. This means that (for most configurations) adding the assembly reference to your project should be all that is required.

Setting the Log Level threshold

By default, GL4N will only log messages above the Warn log level. The best way to modify this default is to configure GL4N via your log4net configuration (shown below). However, if everything works great and you just want to change the default log level, you may do so by setting the Glimpse.Log4Net.Appender.GlimpseAppender.DefaultThreshold property to the desired threshold.

For example, you would use the following code to log Debug messages (and above):

Glimpse.Log4Net.Appender.GlimpseAppender.DefaultThreshold = log4net.Core.Level.Debug;
Note that this is a static property so it is applied globally!

Enhanced Configuration (via log4net)

At the end of the day, GL4N is just a log4net appender that appends to Glimpse rather than, say, a physical log file. This means that you configure it just like any other log4net appender.

For example:

<log4net>
	<appender name="GlimpseAppender" type="Glimpse.Log4Net.Appender.GlimpseAppender" />
	<root>
		<level value="ALL" />
		<appender-ref ref="GlimpseAppender" />
	</root>
</log4net>

Note that, with this configuration in place, GL4N will use the configured appender and not create its own.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.