stacks-logging

Integrates a unified logging system for Stacks applications via a central config and file-based logger.

622|17|Updated Apr 26, 2022
One-click install
npx skills add https://github.com/stacksjs/stacks --skill stacks-logging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stacks-logging
Source: https://github.com/stacksjs/stacks/tree/main/.claude/skills/stacks-logging
Command: npx skills add https://github.com/stacksjs/stacks --skill stacks-logging

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Logging across a Stacks application can be inconsistent and fragmented. This skill provides a unified logging approach using the log facade, enabling consistent levels (info, error, warn, debug, success), structured data, and file-based logging.

Core Features & Use Cases

  • Centralized log facade: standardizes info, warning, error, and debug logs across frontend, API, and CLI components.
  • File-based logging and configuration: writes to storage/logs/stacks.log and uses config/logging.ts for deployment-specific paths.
  • Debugging aids: dump/dd helpers, timing utilities, and easy integration with existing application code for performance tracing.

Quick Start

Install and configure the Stacks logging package, then start using log.info and log.debug in your application.

Frequently Asked Questions about stacks-logging

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

FAQPage Schema
How do I configure centralized logging across a full-stack application?

Centralized logging uses a log facade to standardize info, warn, error, and debug levels across frontend, API, and CLI components. You configure deployment-specific paths in a central configuration file to ensure consistent application tracing.

What is the best way to write application logs to a file locally?

File-based logging writes application output directly to a local file like storage/logs. It uses a central configuration file to manage deployment-specific log paths, ensuring all application components write traces to a unified location.

Can I use a single logging configuration for frontend, backend, and CLI environments?

Yes, a unified logging system applies a single configuration across frontend, backend, CLI, and cloud components. This satisfies cross-component logging requirements for consistent tracing and error reporting in development and production.

How do I add debug helpers and timing utilities to my application logs?

Debugging aids include dump/dd helpers and timing utilities integrated directly into application code. These helpers work alongside the log facade to provide detailed performance tracing and state inspection during development.

Where do I configure deployment-specific log file paths?

Deployment-specific log paths are configured in a central configuration file, typically located at config/logging.ts. This file directs the file-based logger to write traces to the correct storage location for each environment.