logging

Implement structured JSONL logging in SideQuest plugins using the @side-quest/core logging factory.

6|1|Updated Nov 26, 2025
One-click install
npx skills add https://github.com/nathanvale/side-quest-marketplace-old --skill logging-nathanvale
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: logging
Source: https://github.com/nathanvale/side-quest-marketplace-old/tree/main/plugins/plugin-template/skills/logging
Command: npx skills add https://github.com/nathanvale/side-quest-marketplace-old --skill logging-nathanvale

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @side-quest/core.

What problem does it solve? Plugin developers often lack a consistent, structured approach to logging, making it hard to debug failures, trace operations across subsystems, and analyze plugin behavior after the fact. ## Core Features & Use Cases - Structured JSONL Logging: Create plugin loggers with named subsystems, log levels, and automatic file rotation using the @side-quest/core logging factory. - Correlation ID Tracing: Generate and propagate correlation IDs through function calls to trace individual operations across scraper, API, and cache subsystems. - Log Analysis Workflows: Filter and inspect logs with jq commands by level, subsystem, or correlation ID for debugging. - Use Case: When a plugin's scraper fails intermittently, add subsystem loggers with correlation IDs, then grep the JSONL log file by correlation ID to reconstruct the exact sequence of events leading to the failure. ## Quick Start Add structured logging to my plugin by creating a logger module with createPluginLogger, initializing it at the entry point, and adding correlation IDs to all log calls.

Frequently Asked Questions about logging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add structured logging to a TypeScript plugin?▼

Add @side-quest/core as a dependency, create a logger module calling createPluginLogger with your plugin name and subsystems, then call initLogger at entry points. Export subsystem loggers and use template literal syntax like logger.info`message ${cid}`.

How do I trace requests across plugin functions with correlation IDs?▼

Generate a correlation ID with createCorrelationId at the start of each operation, then pass it through every function call and include it in all log messages. This lets you filter logs by ID to reconstruct a complete operation trace.

Where are plugin log files stored and what format do they use?▼

Logs are written to ~/.<plugin-name>/logs/<plugin-name>.jsonl in JSON Lines format. Files rotate automatically at 1 MiB by default, keeping up to 5 rotated files, both configurable in createPluginLogger options.

How do I filter JSONL logs by level or subsystem?▼

Use jq to filter the JSONL log file, for example jq 'select(.level == "error")' for errors or jq 'select(.category[1] == "scraper")' for a subsystem. Use grep with a correlation ID to trace a single operation.

Why are my plugin logs not being created?▼

Logs are not created when initLogger() is not called before any logging calls, or when async operations are not awaited. Verify initLogger runs at the start of CLI tools and MCP server startup.

How do I reduce log verbosity in production?▼

Set lowestLevel to "info" in the createPluginLogger configuration to skip debug logs in production. You can also reduce maxFiles or maxSize if disk usage from rotated logs becomes a concern.