-
Notifications
You must be signed in to change notification settings - Fork 165
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
Update AspNetCore and Hosting Dependencies/Features to Match MEH #681
Comments
I think this is a good idea! But I don't fully understand why you can't use NLog.Web.AspNetCore+NLog.Extensions.Hosting now? Is that because NLog.Extensions.Hosting is targeting less platforms (no netstandard 1.x, no net framework)? |
We are using both, it's mostly just that there are features that were originally implemented in the ASP.NET package which can now be supported in the generic host package. We'd like to use those in the config file we share with both packages. The rest is more of a conceptual arrangement of dependencies since our AspNetCore hosting package references our MEH package which references our logging package (the same as the MS dependency chain) but the NLog refs we have don't follow the same hierarchy. |
It would also be ideal to expose |
@TheXenocide You are very welcome to create a pull-request with your ideas. |
We have already, NLog.Extensions.Hosting -> NLog.Extensions.Logging`. So we only need So moving this to the NLog.Web repo |
Indirectly the dependencies won't change as:
|
ow the platform support is different
|
With the drop of ASP.NET Core 1 and NLog/NLog.Extensions.Logging#528, we could do this :) |
Unfortunate this isn't an option regarding .NET 4.6.1. See NLog/NLog.Extensions.Logging#527 The issue is then we could not support ASP.NET Core 2 with .NET 4.6.1. And for now that is still supported. |
targeting 6.0 |
Bug(?)/Improvement(?)
NLog version: 4.6.8
NLog.Extensions.Logging version: 1.6.1
NLog.Web.AspNetCore version: 4.9.0
Platform: .NET Framework 4.8, .NET Core 3.1, .NET Standard 2.0
Currently there are features that could be universally supported for all applications referencing the Microsoft.Extensions.Hosting generic application host but that are only currently supported in ASP.NET Core (e.g.
${aspnet-environment}
). Since ASP.NET Hosting now uses Microsoft.Extensions.Hosting and desktop applications that are likely to use Microsoft.Extensions.Logging will often do so through Microsoft.Extensions.Hosting going forward it seems like the feature support (and dependency hierarchy) should be organized in the same order as the Microsoft types (i.e. since Microsoft's Dependencies goASP.NET -> Microsoft.Extensions.Hosting -> Microsoft.Extensions.Logging
it would be ideal for NLog dependencies to mirror this, e.g.NLog.Web.AspNetCore -> NLog.Extensions.Hosting -> NLog.Extensions.Logging
)One reason this comes up for us is because we use Microsoft.Extensions.Hosting for a single product that contains both .NET 4.8 and .NET Core 3.1 applications. For re-use and establishing base patterns we have various hosting libraries with extension methods to set the hosts up the way we like and since our general NLog extensions (we have custom formatters, conditions, etc.) and common NLog.config file are universal they are defined in a library that also exposes the extension methods designed to be used with Microsoft.Extensions.Hosting. Now that we're adding an ASP.NET Core hosting library, it references NLog.Web.AspNetCore as well as our NLog package (and therefore references NLog.Extensions.Hosting).
We would really like to use the environment name in our universal config file but they are currently only features of the ASP.NET Core. Additionally we would like our dependency hierarchies for the packages we're generating and consuming to match up to reduce risk of divergence in the future (this hasn't caused an critical issues yet so far as I can tell, but it seems like it would make sense).
The text was updated successfully, but these errors were encountered: