skills-catalog/ln-771-logging-configurator/SKILL.md
Configures structured JSON logging with Serilog (.NET) or structlog (Python). Use when adding logging to backend projects.
npx skillsauth add levnikolaevich/claude-code-skills ln-771-logging-configuratorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Type: L3 Worker Category: 7XX Project Bootstrap
Configures structured JSON logging for .NET and Python projects.
| Aspect | Details | |--------|---------| | Input | Context Store from ln-770 | | Output | Logging configuration files | | Stacks | .NET (Serilog), Python (structlog) |
Accept Context Store from coordinator.
Required Context:
STACK: .NET or PythonFRAMEWORK: ASP.NET Core or FastAPIFRAMEWORK_VERSION: Version numberPROJECT_ROOT: Project directory pathENVIRONMENT: Development or ProductionValidation:
STACK not provided, detect from project filesUse MCP tools to get up-to-date documentation.
For .NET (Serilog):
MCP ref: "Serilog ASP.NET Core structured logging configuration"
Context7: /serilog/serilog-aspnetcore
For Python (structlog):
MCP ref: "structlog Python structured logging configuration"
Context7: /hynek/structlog
Key Patterns to Research:
Ask user for configuration preferences.
| Option | When to Use | |--------|-------------| | JSON (Recommended for Production) | Machine-readable, log aggregation systems | | Pretty/Colored (Recommended for Development) | Human-readable, local debugging |
| Field | Description | Default |
|-------|-------------|---------|
| correlationId | Request tracking across services | ✓ Yes |
| userId | Authenticated user identifier | ✓ Yes |
| requestPath | HTTP request path | ✓ Yes |
| responseTime | Request duration in ms | ✓ Yes |
| machineName | Server hostname | Optional |
| threadId | Thread identifier | Optional |
| Sink | Use Case | |------|----------| | Console | Always enabled | | File | Local persistence, log rotation | | Seq | Structured log server | | Elasticsearch | Log aggregation at scale |
| Level | Development | Production | |-------|-------------|------------| | Default | Debug | Information | | Microsoft.* | Information | Warning | | System.* | Information | Warning | | Application | Debug | Information |
Generate files based on stack and decisions.
| File | Purpose |
|------|---------|
| Extensions/LoggingExtensions.cs | Service registration |
| appsettings.json (update) | Serilog configuration |
| appsettings.Development.json (update) | Dev overrides |
Generation Process:
Packages to Add:
Serilog.AspNetCoreSerilog.Sinks.ConsoleSerilog.Sinks.File (if File sink selected)Serilog.Enrichers.Environment (if machineName selected)| File | Purpose |
|------|---------|
| core/logging_config.py | structlog configuration |
| middleware/logging_middleware.py | Request logging |
Generation Process:
Packages to Add:
structlogpython-json-logger (if JSON format)Verify the configuration works.
Validation Steps:
Check imports: Ensure all packages are available
dotnet list package | grep Serilogpip list | grep structlogSyntax check:
dotnet build --no-restorepython -m py_compile core/logging_config.pyTest log output:
Expected Log Format:
{
"timestamp": "2026-01-10T12:00:00.000Z",
"level": "info",
"message": "Request completed",
"correlationId": "abc-123",
"requestPath": "/api/health",
"responseTime": 45,
"statusCode": 200
}
Return result to ln-770:
{
"status": "success",
"files_created": [
"Extensions/LoggingExtensions.cs",
"appsettings.json"
],
"packages_added": [
"Serilog.AspNetCore",
"Serilog.Sinks.Console"
],
"registration_code": "services.AddLoggingServices(configuration);",
"message": "Configured structured logging with Serilog"
}
This skill is idempotent:
{ "status": "skipped", "message": "Logging already configured" }status: "skipped" immediatelyfiles_created, packages_added, registration_code for coordinator aggregationdotnet build or py_compile)Version: 2.0.0 Last Updated: 2026-01-10
testing
Audits architecture config boundaries: typed settings, scattered env reads, config leakage, and layer ownership. Use for config architecture.
tools
Finds architecture-level modernization opportunities: obsolete custom mechanisms, overbuilt extension points, and simplifiable architecture. Use when auditing architecture evolution.
development
Builds dependency topology, detects cycles, validates import rules, and calculates coupling metrics. Use when auditing architecture topology.
testing
Checks layer, resource ownership, and orchestration boundaries. Use when auditing architecture boundary enforcement.