iflight / Logging.Memory

Logging.Memory allows write log to memory
MIT License
9 stars 8 forks source link

Logging.Memory

NuGet package Logging.Memory

How to use

1. Enable Logging in Startup.cs

    public void Configure(IApplicationBuilder app,
        IHostingEnvironment env,
        ILoggerFactory loggerFactory)
    {
        ...
        loggerFactory.MinimumLevel = LogLevel.Debug;
        loggerFactory.AddMemory();
        ...
    }

2. Now you can get log from static List everywhere

var logList = MemoryLogger.LogList;

Since v2.0.0 you can get log for concrete LogLevel:

var warnLog = MemoryLogger.GetLog(LogLevel.Warning);