What problem does it solve?
Legacy .NET logging often uses string concatenation or interpolation, producing unstructured messages that are hard to query and correlate. This skill modernizes ILogger and Serilog calls to structured message templates and ensures proper Serilog file sink JSON configuration.
Core Features & Use Cases
- Structured Logging Migration: parses C# files and rewrites log calls from concatenated strings, String.Format, or interpolated strings into message templates with named properties.
- CommandHandler Scope Insertion: optionally adds BeginScope blocks that capture command identifiers such as Id, UserId, TransactionId for richer correlation.
- Serilog File Sink Configuration: detects Serilog package references and updates appsettings JSON files to use JSON file sinks with a custom formatter and correct file extensions.
- Safe Dry‑Run Workflow: generates a unified diff and a preview report for review before any changes are applied, with backup and optional git commit.
Quick Start
Use dev-structured-logs to run a dry‑run migration of logging in your repository and apply the changes after review.