ln-771-logging-configurator
Configures structured JSON logging with Serilog (.NET) or structlog (Python). Use when adding logging to backend projects.
What this skill does
# ln-771-logging-configurator
**Type:** L3 Worker
**Category:** 7XX Project Bootstrap
Configures structured JSON logging for .NET and Python projects.
---
## Overview
| Aspect | Details |
|--------|---------|
| **Input** | Context Store from ln-770 |
| **Output** | Logging configuration files |
| **Stacks** | .NET (Serilog), Python (structlog) |
---
## Phase 1: Receive Context
Accept Context Store from coordinator.
**Required Context:**
- `STACK`: .NET or Python
- `FRAMEWORK`: ASP.NET Core or FastAPI
- `FRAMEWORK_VERSION`: Version number
- `PROJECT_ROOT`: Project directory path
- `ENVIRONMENT`: Development or Production
**Validation:**
- If `STACK` not provided, detect from project files
- If version not provided, use latest stable
---
## Phase 2: Research Current Best Practices
Use 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:**
1. Request logging middleware
2. Log enrichment (correlation ID, user context)
3. Log level configuration by environment
4. Sink configuration (Console, File, Seq, Elastic)
---
## Phase 3: Decision Points
Ask user for configuration preferences.
### Q1: Log Format
| Option | When to Use |
|--------|-------------|
| **JSON** (Recommended for Production) | Machine-readable, log aggregation systems |
| **Pretty/Colored** (Recommended for Development) | Human-readable, local debugging |
### Q2: Enrichment Fields
| 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 |
### Q3: Log Sinks
| Sink | Use Case |
|------|----------|
| **Console** | Always enabled |
| **File** | Local persistence, log rotation |
| **Seq** | Structured log server |
| **Elasticsearch** | Log aggregation at scale |
### Q4: Log Levels by Environment
| Level | Development | Production |
|-------|-------------|------------|
| Default | Debug | Information |
| Microsoft.* | Information | Warning |
| System.* | Information | Warning |
| Application | Debug | Information |
---
## Phase 4: Generate Configuration
Generate files based on stack and decisions.
### .NET Output Files
| File | Purpose |
|------|---------|
| `Extensions/LoggingExtensions.cs` | Service registration |
| `appsettings.json` (update) | Serilog configuration |
| `appsettings.Development.json` (update) | Dev overrides |
**Generation Process:**
1. Use MCP ref to get current Serilog API
2. Generate LoggingExtensions.cs with:
- UseSerilog configuration
- Request logging middleware
- Enrichment configuration
3. Update appsettings.json with Serilog section
**Packages to Add:**
- `Serilog.AspNetCore`
- `Serilog.Sinks.Console`
- `Serilog.Sinks.File` (if File sink selected)
- `Serilog.Enrichers.Environment` (if machineName selected)
### Python Output Files
| File | Purpose |
|------|---------|
| `core/logging_config.py` | structlog configuration |
| `middleware/logging_middleware.py` | Request logging |
**Generation Process:**
1. Use MCP ref to get current structlog API
2. Generate logging_config.py with:
- Processor chain configuration
- Renderer selection (JSON/Console)
- Log level configuration
3. Generate logging_middleware.py for FastAPI
**Packages to Add:**
- `structlog`
- `python-json-logger` (if JSON format)
---
## Phase 5: Validate
Verify the configuration works.
**Validation Steps:**
1. **Check imports:** Ensure all packages are available
- .NET: `dotnet list package | grep Serilog`
- Python: `pip list | grep structlog`
2. **Syntax check:**
- .NET: `dotnet build --no-restore`
- Python: `python -m py_compile core/logging_config.py`
3. **Test log output:**
- Start application
- Make test request
- Verify log format matches configuration
**Expected Log Format:**
```json
{
"timestamp": "2026-01-10T12:00:00.000Z",
"level": "info",
"message": "Request completed",
"correlationId": "abc-123",
"requestPath": "/api/health",
"responseTime": 45,
"statusCode": 200
}
```
---
## Return to Coordinator
Return result to ln-770:
```json
{
"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"
}
```
---
## Idempotency
This skill is idempotent:
- Phase 1: Check if logging already configured (Grep for Serilog/structlog)
- If configured: Return `{ "status": "skipped", "message": "Logging already configured" }`
- If not: Proceed with configuration
---
## Reference Links
- [Serilog.AspNetCore](https://github.com/serilog/serilog-aspnetcore)
- [structlog Documentation](https://www.structlog.org/)
- [ASP.NET Core Logging](https://learn.microsoft.com/aspnet/core/fundamentals/logging/)
---
## Critical Rules
- **Use MCP ref/Context7 for current API** — do not hardcode Serilog/structlog config from memory
- **Idempotent** — if Serilog or structlog already configured, return `status: "skipped"` immediately
- **Environment-aware log levels** — Debug for Development, Information for Production (never Warning default)
- **Always include correlation ID enrichment** — required for distributed tracing
- **Return structured response** — `files_created`, `packages_added`, `registration_code` for coordinator aggregation
## Definition of Done
- [ ] Context Store received and validated (stack, framework, version)
- [ ] Best practices researched via MCP tools for target stack
- [ ] User decisions collected (format, enrichment, sinks, log levels)
- [ ] Configuration files generated (extensions/config + appsettings or Python modules)
- [ ] Syntax validated (`dotnet build` or `py_compile`)
- [ ] Structured JSON response returned to ln-770 coordinator
---
**Version:** 2.0.0
**Last Updated:** 2026-01-10
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.