Skip to content

bigpilot/SimpleLoggers.NET

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleLoggers.NET

(for those of you tired of struggling with Log4Net and just want to get things done)

Logging capability is something you need in almost every project. However, I believe that full-featured loggers like Log4Net are too heavy and cumbersome to use. I therefore prefer my own simpler loggers which I've used on many projects. I usually use the EventViewerLogger and the TextFileLogger and DebugWindowLogger in specialized situations.

This project contains the following loggers:

  • EventViewerLogger
  • TextFileLogger
  • DebugWindowLogger
  • ConsoleLogger
  • TraceLogger
  • DatabaseLogger (for Entity Framework, should work with most databases)
  • DailyTextFileLogger with timestamping in the logfile name

and a simple Exception logging helper:

LogHelper

which you can use like this:

      ILogger logger = new ConsoleLogger();

      try
      {
          throw new DivideByZeroException("Cannot divide by zero!");
      }
      catch (Exception ex)
      {
          LogHelper.LogException("Failed to divide by zero!", logger, ex);
      }

These loggers are intended to be used with a Dependency Injection (DI) framework such as AutoFac or Ninject, but can also be manually created on the fly.

Although targeted at .NET Standard 2.0, these loggers will mostly be used in Business Logic on the server or desktop.

Roadmap

  • Examples with usage scenario's

License

This project is licensed under the most permissive license available: the MIT License.

Availability

Also available as a NuGet package from NuGet.org

About

Simple loggers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages