-
Notifications
You must be signed in to change notification settings - Fork 796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UseSerilog support for .net 7 CreateApplicationBuilder and HostApplicationBuilder #1855
Comments
an interesting aspect is the global namespace program.cs file. i'd like if we could just builder.Logger.UseSerilog and then add configuration from there, all within builder.Logger. No more redefining Log constant at top except for logging before builder.build() and no need for Host. In most cases I'd guess it'd be just changing from 'Host' to 'Logging' in user code, but I think there is more going on in the backend? |
it's also unclear if/when a new console app will come out to match the new webapplication. this may be something to plan for as well. also i think it's .net6 and up support this |
At the same time, I hope to consider the part of MAUI, which comes from: Microsoft.Maui.Hosting.MauiAppBuilder. thx. At present, I have finished my work in this way. Code:
|
I think this went into Serilog.Extensions.Hosting last week: serilog/serilog-extensions-hosting#70 - should now be on NuGet in the lastest -dev version of that package. Please let me know if it's not a match. Thanks! |
Can we revisit this issue? It's not been fully addressed. We are expecting to see an extension method on the Reference: SerilogHostBuilderExtensions.cs. |
@nblumhardt Any plans to add the above discussed extension method? |
@silkfire I think |
Sure, as long as it's made clear in the documentation that UseSerilog cannot be used anymore with this scenario. Otherwise it's confusing why there's no equivalent for it when using minimal APIs. |
👍 raised serilog/serilog-aspnetcore#368 - thanks! |
Are there any plans to implement another UseSerilog extension method for the new application bootstrapper method from .net 7?
https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.hosting.host.createapplicationbuilder
dotnet/runtime#61634
The text was updated successfully, but these errors were encountered: