Sets up Serilog structured logging in ASP.NET Core with JSON output, enrichers, request logging, log levels, sinks (Seq/Elastic/console), and trace correlation.
Ships in TheCodeMan .NET AI ToolKit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Wire up Serilog in ASP.NET Core for structured (JSON) logs with enrichers, request logging, sensible levels, and sinks — correlated with your traces.
Works on a target: a project or GitHub URL. Inspect current logging: grep -rn "UseSerilog\|ILogger\|Log.Logger\|AddSerilog" --include=*.cs <target>. If OTel is present, wire log/trace correlation.
dotnet add package Serilog.AspNetCore
dotnet add package Serilog.Sinks.Seq # or Console/Elastic/etc.
builder.Host.UseSerilog((ctx, services, lc) => lc
.ReadFrom.Configuration(ctx.Configuration)
.ReadFrom.Services(services)
.Enrich.FromLogContext()
.Enrich.WithMachineName()
.Enrich.WithProperty("service", "orders")
.WriteTo.Console(new RenderedCompactJsonFormatter()) // structured JSON
.WriteTo.Seq(ctx.Configuration["Seq:Url"]!));
app.UseSerilogRequestLogging(); // one tidy log line per request instead of the default noise
// GOOD: message template + properties (queryable)
logger.LogInformation("Order {OrderId} placed by {CustomerId} for {Total}", id, customerId, total);
// BAD: interpolated string (loses structure)
logger.LogInformation($"Order {id} placed");
Information default, Warning for noisy frameworks, Debug only in dev. Configure via appsettings.correlation-id-middleware).UseSerilogRequestLogging for one structured line per request with status + duration.TraceId/SpanId so logs link to traces.Information for business events, Error with the exception object (not ex.Message)."Set up Serilog with JSON logs and Seq", "add request logging", "correlate my logs with traces", "fix my logging to be structured". Pairs with opentelemetry-setup and correlation-id-middleware.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/dotnet-ai-toolkit:serilog-logging-setupfrom TheCodeMan .NET AI ToolKit
npx claudepluginhub stefanthecode/dotnet-ai-toolkit --plugin dotnet-ai-toolkit49 skills in this plugin
/adonet-data-access-auditorAudit and fix classic ADO.NET data-access code (SqlConnection / SqlCommand / SqlDataReader / DataSet) on .NET Framework. Use this skill whenever the user shares raw ADO.NET code, a DAL / repository built on SqlCommand, stored-proc calls, string-concatenated SQL, or mentions SQL injection, parameterized queries, connection leaks, "using / Dispose", reading the same column multiple times, transactions, or "why does my old data layer leak connections / is it safe". Always use this skill for classic ADO.NET review instead of answering from memory; it applies a fixed security + correctness + performance checklist and rewrites the code./async-await-auditorAudit C#/.NET code for async/await anti-patterns and concurrency bugs. Use this skill whenever the user shares async C# code or asks about deadlocks, async void, .Result/.Wait(), blocking calls, ConfigureAwait, sync-over-async, fire-and-forget tasks, CancellationToken usage, or "why does my async code hang/deadlock". Always use this skill for async correctness/performance reviews instead of answering from memory; it applies a fixed checklist and rewrites the code./authorization-policy-generatorDesign ASP.NET Core authorization — policy-based, role-based, and claims/requirement-based with custom authorization handlers and resource-based checks. Use this skill whenever the user wants authorization policies, role/claim checks, custom AuthorizationHandler, resource-based authorization, permission checks, or asks "how do I authorize this / policy vs role / restrict this endpoint to X". Always use this skill for authorization requests; it generates policies, handlers, and endpoint wiring.Other plugins' skills for the same job