nreco / logging

Generic file logger for .NET Core (FileLoggerProvider) with minimal dependencies
MIT License
284 stars 56 forks source link

Good project! Support for .NET 8? console log was changed after add this lib. #60

Open pigLoveRabbit520 opened 8 months ago

pigLoveRabbit520 commented 8 months ago

windows 10 .NET 8

var builder = Host.CreateApplicationBuilder();
builder.Logging.AddFile("app.log", append: true); // add this row
builder.Logging.AddSimpleConsole(option =>
{
    option.IncludeScopes = true;
    option.TimestampFormat = "MM-dd HH:mm:ss ";
});

Preview console log: image

Later console log: image

VitaliyMF commented 8 months ago

Do you mean that adding

builder.Logging.AddFile("app.log", append: true);

somehow affects your console log output?.. Do you mean that after that you don't see log entries that are displayed when you comment out 'AddFile' call? I have no idea how this could be possible at all.

Do you have a sample console app that I may use to reproduce the issue?

VitaliyMF commented 8 months ago

@pigLoveRabbit520 Please try to reference the latest NReco.Logging.File 1.2.0, it has a target for net8.0 which references appropriate Microsoft.Extensions.Logging version (8.0).