Feature/2 logging abstractions - #5
Merged
Merged
Conversation
- add SyncConsoleLoggerProvider/SyncConsoleLogger in Logging/, writing synchronously to Console.Out to avoid Microsoft.Extensions.Logging.Console's async queue, which caused log output to interleave out of order with Program's own narration - wire logger into SecretsManagerServiceFactory.Create via ILoggerFactory.SetMinimumLevel(Debug), demonstrating a fully custom, non-Microsoft ILogger consumed by the library - restructure demo sequence to insert a fetch between InvalidateCache and RefreshSecretAsync, so each step's log output actually proves its narration (invalidate clearing the cache, refresh bypassing a warm cache) rather than asserting it - remove hardcoded "[cache hit]" console message, now redundant with the library's real Debug-level cache-hit log
- add NLog.Extensions.Logging to MvcExample.Infrastructure; bridge NLogLoggerProvider -> ILogger in SecretsManagerAccessor.Initialize(), passed into SecretsManagerServiceFactory.Create - add nlog.config (File + Debugger targets, minlevel=Debug) - add one Log.Info call in WeatherController.Index(cityName) as a smoke test for the wiring
…rosoft.Extensions.* versions
- Library now floors Microsoft.Extensions.Logging.Abstractions at 8.0.0
instead of hard-requiring 10.0.10, so it no longer forces a version
split against NLog.Extensions.Logging's net48-compatible dependency
set (which only offers the 8.x generation)
- Confirmed via the built assemblies: every Microsoft.Extensions.* DLL
and System.Diagnostics.DiagnosticSource now resolve to a single
consistent 8.0.0.0 — no binding redirects needed for this cluster
- Add <extensions><add assembly="NLog.Web"/></extensions> to
nlog.config so NLog registers NLog.Web's layout renderers
(${aspnet-appbasepath}) instead of failing to parse the config
- Replace Trace.TraceError with Log.Error(ex, "...") using NLog's
exception-first pattern and structured placeholders, consistent
with the existing Log.Info call in WeatherController
- Wire up a Logger in Global.asax.cs for the Application_Start
init-failure case
…Accessor.Initialize() - add a dedicated NLog.Logger to SecretsManagerAccessor (GetCurrentClassLogger, same pattern as WeatherController/Global.asax.cs), distinct from the ILogger bridge passed into SecretsManagerServiceFactory.Create, which is scoped to SecretsManagerService specifically - log the resolved backend source (AWS/LocalStack/local fallback) and, when set, the resolved absolute LocalJsonFallbackPath, before the service is constructed — surfaces the accessor's own startup decisions in the log rather than only becoming visible via the "how this worked" panel on first request - resolved path logging specifically targets the IIS working-directory fallback-path bug already documented in ResolveLocalJsonFallbackPath
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Demonstrates DGates.AwsSecretsManager's ILogger integration against two different frameworks:
Microsoft.Extensions.Logging.Console's async queue so log output stays correctly
interleaved with the demo's step-by-step narration
app's own logging (WeatherController, Global.asax.cs, SecretsManagerAccessor), replacing
the previous System.Diagnostics.Trace calls
Bumps DGates.AwsSecretsManager to 1.0.0-beta.3.