Skip to content
/ LogExCore Public

ExtLog.NET is a library that adds few really convenient features to Microsoft.Extensions.Logging

Notifications You must be signed in to change notification settings

mezm/LogExCore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LogExCore

Build and Run Tests NuGet

LogExCore is a library that extends Microsoft.Extensions.Logging. Now it contains only SingleLineConsoleLogger. But there are plans to add few more, for example FileLogger

Install

To install LogExCore run:

Install-Package LogExCore

Loggers

SingleLineConsoleLogger

SingleLineConsoleLogger is similar to Microsoft.Extensions.Logging.Console.ConsoleLogger but write each log message by a single line.

To use it in ASP.NET CORE you should modify Program.cs:

using LogExCore;

...

public static IHostBuilder CreateHostBuilder(string[] args) =>
    Host.CreateDefaultBuilder(args)
        .ConfigureLogging(logging =>
        {
            logging.ClearProviders();
            logging.AddSingleLineConsole(); // set SingleLineConsoleLoggerProvider
        })
        .ConfigureWebHostDefaults(webBuilder =>
        {
            webBuilder.UseStartup<Startup>();
        });

To use it in console application you can write something like this:

using LogExCore;

...

var loggerFactory = LoggerFactory.Create(builder => builder.AddSingleLineConsole());
var logger = loggerFactory.CreateLogger<Program>();

About

ExtLog.NET is a library that adds few really convenient features to Microsoft.Extensions.Logging

Topics

Resources

Stars

Watchers

Forks

Languages