podverse-logging-log-dir

Configure LOG_DIR to route logs to console or a mounted volume.

6|5|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/podverse/podverse --skill podverse-logging-log-dir
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: podverse-logging-log-dir
Source: https://github.com/podverse/podverse/tree/main/.cursor/skills/logging
Command: npx skills add https://github.com/podverse/podverse --skill podverse-logging-log-dir

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Ensures consistent, environment-driven log directory behavior across the monorepo, preventing unintended file logging and enabling controlled log destinations.

Core Features & Use Cases

  • No default log directory: code relies on process.env.LOG_DIR ?? '' to avoid hard-coded paths.
  • Adaptive logging: when LOG_DIR is empty or unset, logs go to console; when LOG_DIR is set, logs are written to the configured external volume path.
  • Avoid bulky containers: never default to ./logs or /app/logs; rely on explicit volume mounts and environment configuration.

Quick Start

Audit all apps and packages to ensure they honor LOG_DIR and enable file logging only when a valid external volume is mounted.

Frequently Asked Questions about podverse-logging-log-dir

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

FAQPage Schema
How do I standardize LOG_DIR handling across a Node monorepo?

Standardize LOG_DIR handling by reading the environment variable and avoiding hard-coded paths. Apps use process.env.LOG_DIR ?? '' to ensure logs route to console when unset, or to a mounted volume when configured.

Why does my container write bulky log files to default directories like ./logs?

Default file logging occurs when hard-coded paths like ./logs or /app/logs are used. To prevent bulky containers, code must rely on explicit environment configuration and volume mounts rather than default directories.

What is the best way to switch Node application logging between console and file output?

Adaptive logging switches output based on the LOG_DIR environment variable. When LOG_DIR is empty or unset, logs print to console; when set to a valid external volume path, logs are written to that directory.

How do I audit monorepo apps to ensure they honor environment-driven log directories?

Audit all apps and packages to verify they read LOG_DIR from the environment and enable file logging exclusively when a valid external volume is mounted, removing any hard-coded log paths.

Can I use LOG_DIR configuration without mounting an external volume in my containers?

Yes, when LOG_DIR is unset or empty, applications fall back to printing logs directly to the console. This approach avoids bulky containers by never defaulting to local file logging without a mounted volume.

When should I not use hard-coded log paths in a monorepo?

Hard-coded log paths should never be used when standardizing monorepo log transport. Relying on process.env.LOG_DIR ensures consistent, environment-driven behavior and prevents unintended file logging across different deployments.