nano-core/nano.templates/nano-add-logging-provider

Claude Code and agent skill by nano-core/nano.templates

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Add a Nano logging provider (Log4Net, Microsoft, NLog, or Serilog) to a Nano.Library-based application - registers the provider in Program.cs and adds the Logging configuration section to appsettings.json. Use when the user asks to add logging, set up a specific logging provider, or switch the logging provider in a Nano API, Web, or Console application.

Install

npx vskill@latest install nano-core/nano.templates/nano-add-logging-provider

SKILL.md

The same SKILL.md was published earlier as nano-core/nano.templates/nano-add-logging-provider.

Nano add logging provider

Wires a Nano logging provider into an existing Nano API, Web, or Console application. Read AGENTS.md in the target repo root first — it documents Nano.Logging's registration one-liner, the four providers' package names, and the exact Logging config shape/defaults under its ## Nano.Logging section; this skill does not repeat any of that, only how to apply it correctly to an existing project without breaking what's already there.

Before making any change, determine

  1. Which provider. One of Log4Net, Microsoft, NLog, Serilog (see AGENTS.md's

provider table for the package/type names). Ask the user if not already given.

  1. Is a provider already registered? Nano supports exactly one logging provider at a

time — check Program.cs for an existing .AddNanoLogging<...>() call. If one exists for a different provider, tell the user this will replace it (remove the old using, provider call, and reference) rather than silently adding a second one. If it's already the same provider, say so and stop — nothing to do.

  1. Is a package reference even needed? Check whether the provider's type already resolves

without adding anything: look for a PackageReference to NanoCore or Nano.All (they're identical, see AGENTS.md) on the application project itself, or on a .Models project it reaches via ProjectReference (AGENTS.md's "quick start" convention — either package pulls in every Nano package, including every logging provider, transitively). If found, no package change is needed at all — skip straight to Program.cs.

  • Otherwise, the project uses the explicit/granular convention: add

<PackageReference Include="Nano.Logging.<Provider>" Version="X.Y.Z" /> to the application project's .csproj (never a .Models project — per AGENTS.md, providers belong on the app project, Nano.App is the only Nano package .Models needs), using the exact same version as the project's existing Nano.App.Api/Nano.App.Web/ Nano.App.Console reference. Don't invent or guess a version.

  • Never add a ProjectReference to Nano.Library source — always a NuGet PackageReference,

even if the rest of the project currently references Nano.Library from source. Some internal Nano.Library development repos do that for their own convenience but explicitly document it as something to replace with NuGet packages before deployment — it's not the convention to extend into a new reference.

Program.cs

Add the registration call AGENTS.md's ### Registration section shows, inside the existing .ConfigureServices(...) lambda — don't create a second .ConfigureServices call if one already exists. This needs two usings, not one — AddNanoLogging<TProvider>() itself lives in Nano.Logging.Extensions, a different namespace than TProvider, which lives in the specific provider package's own namespace (e.g. Nano.Logging.Serilog for SerilogProvider). Add both; forgetting Nano.Logging.Extensions is an easy miss since AGENTS.md's registration snippet doesn't spell out usings at all.

  • If the existing lambda parameter is the discard placeholder _ (e.g. `.ConfigureServices(_

=> { // Add your services here. }), the standard blank-app boilerplate), rename it to x and remove the placeholder comment — x` is the Nano convention once the lambda holds a real registration.

  • If other real service registrations already exist in the lambda, just add the

AddNanoLogging<...>() call alongside them; don't touch unrelated lines.

  • Works identically for NanoApiApplication, NanoWebApplication, and NanoConsoleApplication

— the .ConfigureServices(...) call and AddNanoLogging<...>() registration are the same across all three app types (NanoWebApplication extends NanoApiApplication).

appsettings.json

Add the Logging section from AGENTS.md's ### Configuration example to the base appsettings.json only (sibling of App, not nested inside it) — no environment-overlay file needs it.

  • If a Logging section already exists (e.g. from a previously-registered different provider),

leave its LogLevel/LogLevelOverrides values as-is — they're provider-agnostic — and only touch Program.cs and the package/project reference.

After making the change

  • Show the user the modified Program.cs lines, the appsettings.json addition, and — if one

was needed — the PackageReference added to the .csproj. If none was needed (NanoCore/ Nano.All already covers it), say so explicitly rather than leaving it unmentioned.

  • If this replaced a different provider, explicitly list what was removed (old using,

provider call, and reference if one was added for it) alongside what was added, so the user can sanity-check the swap.

  • Don't add any package beyond the logging provider itself, and don't touch Docker/Kubernetes/CI

files — logging provider selection has no effect on any of those.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/nano-core/nano.templates/nano-add-logging-provider/badge)](https://verified-skill.com/skills/nano-core/nano.templates/nano-add-logging-provider)

Something wrong with this skill or its page? Tell us.