Comments (5)
Hi! Thanks for opening your first issue here! Please make sure to follow the issue template - so we could help you better!
from nlog.
Yes that is pretty much the purpose of the different nuget-packages. NLog.Extensions.Logging
+ NLog.Extensions.Hosting
tries to be slim wrappers that only registers NLog as logging-provider.
The LoadConfigurationFromAppSettings
is included with NLog.Web.AspNetCore
because it has all the dependencies included upfront for loading configuration from appsettings.json-file. Allowing it to manually load configuration before the host-builder is ready.
The LoadConfigurationFromAppSettings
is best-effort and not very optimal way of loading the NLog-configuration. It just probes lots of different places for a possible NLog-configuration, which is then loaded. It kind of ressembles how NLog autoloads its Nlog.config
-file.
The goal is that one just uses AddNLog
or UseNLog
for setting up NLog as logging-provider, and those methods will automatically load the NLog-configuration from the host-configuration (if available).
from nlog.
Thank you. Then could you comment on two points from the example I noted on the screenshot? Here I am trying to understand the different configuration going on in two places. Or does the configuration take place in 1 place, and then it will be used in 2? Will the way 1 place is configured affect 2 or are they unrelated?
from nlog.
The only reason for the premature LoadConfigurationFromAppSettings
is for doing early logging (Like logger.Debug("Init main")
) before Host.CreateDefaultBuilder()
.
But UseNLog()
/ AddNLog()
by itself is enough for setting up NLog as Logging Provider, and perform logging using Microsoft Extension Logging ILogger
-interface.
from nlog.
Thanks!
from nlog.
Related Issues (20)
- No logging output when using LogManager.GetCurrentClassLogger() HOT 4
- File log are deleted when MaxArchiveFiles is less than total number of multiple targets HOT 3
- Set license expression on packages HOT 3
- Add additional TFM to reduce dependencies HOT 7
- Deprecate additional Nuget Packages HOT 4
- Allow for the removal of the inherent callsite information in fluent logs (?) HOT 4
- Unused target detected. Add a rule for this target to the configuration. But a rule does exist in the configuration. HOT 4
- NLog.Database version 5.2.8 with net8 error HOT 8
- Visual Studio 2022 build LoggerWrapper project failed with "Can't find .NETFramework,Version=v4.0" error message HOT 7
- NetworkTarget with GELF fails when sending UDP message larger than MaxMessageSize HOT 14
- RegisterObjectTransformation not working with ${exception:format=ToString,Properties,Data} HOT 3
- Logging not working when using Azure SDK from a library project in .NET Core (Dependency Injection) HOT 3
- LogManager.GetLogger(Type) marked as obsolete, what to use instead? HOT 11
- How to get the Request Properties like RequestPath and RequestDetail in a class file, update it and add them back to the logs HOT 7
- Layout.FromMethod that supports typed Layout HOT 3
- [Question] Is there a built-in byte[] to hex formatter? HOT 17
- NLog configuration not loading when running on Ubuntu 22.04 HOT 3
- Support params ReadOnlySpan with NetStandard2.1 and lang version 13
- Veracode scan gives Use of a Broken or Risky Cryptographic Algorithm CWE ID 327 Error for NLog HOT 3
- Please add `queueLimit` and `overflowAction` to `FileTarget`. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nlog.