The Wayback Machine - https://web.archive.org/web/20201024210835/https://github.com/coderrio/Coderr.Client.Log4Net
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 

README.md

log4net integration library

VSTS NuGet

This library will report all exceptions that you log using log4net.

Example

try
{
    SomeBusinessCode();
}
catch (Exception ex)
{
    _logger.Debug("Failed to do business", ex);
}

Result

Will result in an exception in codeRR with the following (extra) context information:

Installation

  1. Download and install the codeRR Community Server or create an account at coderrapp.com
  2. Install this client library (using nuget coderr.client.log4net)
  3. Configure the credentials from your codeRR account in your Program.cs.
  4. Add the following line to activate this library: Err.Configuration.CatchLog4NetExceptions();

Full example:

namespace Coderr.Client.Log4net.Demo
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            XmlConfigurator.Configure(new FileInfo("log4net.config"));

			//when using our live service.
            var url = new Uri("https://report.coderr.io/");
            Err.Configuration.Credentials(url,
                "yourAppKey",
                "yourSharedSecret");

            // injects into the log4net pipeline
            Err.Configuration.CatchLog4NetExceptions();

			
			//try the config
            var log = LogManager.GetLogger(typeof(Program));
            log.Info("Hello word");

            var service = new SomeService();
            service.DoSomeStuff();

            Console.WriteLine("Exception have been logged.");
            Console.ReadLine();
        }
    }
}

Requirements

You need to either install Coderr Community Server or use Coderr Live.

More information

About

Integrates into log4net and reports all logged exceptions to Coderr

Topics

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.