---
name: "winston-multi-transport-logger"
description: "Route logs to multiple outputs, format timestamps, and manage automated daily file rotation."
metadata:
  author: "Winston"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "configure winston logger"
  - "winston daily rotate file"
  - "custom winston format"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Winston Multi-Transport Logging & Daily File Rotation

Configures Winston: defining transports (Console, File, Http), formatting with winston.format (colorize, timestamp, json), integrating winston-daily-rotate-file with retention limits, and exception handling.

## When to Invoke
Invoke this skill whenever you need to:
- configure winston logger
- winston daily rotate file
- custom winston format

## Execution SOP & Rules
1. Create logger: const logger = winston.createLogger({ format: winston.format.combine(winston.format.timestamp(), winston.format.json()), transports: [...] }).
2. Add DailyRotateFile transport specifying filename: 'application-%DATE%.log', maxSize: '20m', maxFiles: '14d'.
3. Log events: logger.info('Transaction processed', { transactionId, amount }).
4. Handle process exits: logger.exceptions.handle(new winston.transports.File({ filename: 'exceptions.log' })).

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
