hamed-shirbandi / InMemoryLogger.Core

Simple library to Log event/errors into memory to be used in ASP.NET Core 2.x Projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is this ?

Simple library to Log event/errors into memory to be used in ASP.NET Core 2.x Projects

By using this library you will have the following features in your project:

  • No need any database config
  • Automatically logging all of the errors and events for each request based on LogLevel.
  • Url to see logs, with search and filtering capabilities.
  • ...

Install via NuGet

To install InMemoryLogger.Core, run the following command in the Package Manager Console.

pm> Install-Package InMemoryLogger.Core

You can also view the package page on NuGet.

How to use ?

1- install package from nuget.

2- add required services to Startup class as below :

     services.AddInMemoryLogger(options=> 
            {
                options.Filter = (loggerName, loglevel) => loglevel >= LogLevel.Error;
                options.Path = "/InMemoryLogs";
            });

3- add middleware to Startup class as below :

   app.UseInMemoryLogger();

4- To view list of logs, enter the url defined at step 2 in browser. like : www.site.com/InMemoryLogs

Screenshots

alt text

Thanks

Sem Shekhovtsov

About

Simple library to Log event/errors into memory to be used in ASP.NET Core 2.x Projects


Languages

Language:C# 99.1%Language:CSS 0.8%Language:JavaScript 0.0%