Skip to main content

Quik Framework :: Logger

Provides configurable loggers such as console or JSON output. The module sets up the logger instance according to configuration and environment.

Installation

npm install @quik/logging

Configuration

Environment overrides:

  • LOGS_ENABLED
  • LOGGER_TYPE (default: console)
  • LOG_LEVEL (default: debug)
  • LOG_FILE (default: app.log)
  • LOG_FOLDER (default: ./storage/logs)

Configuration keys (via @quik/core):

  • logs.enabled
  • logs.type (console, json, no-logger)
  • logs.level (e.g. info, debug, error)
  • logs.file
  • logs.folder

Usage

import { getLogger } from '@quik/core';

getLogger().info('App started');

API Highlights

  • QLogger base logger implementation.
  • QConsoleLogger, QJSONLogger, QNoLogger variants.
  • getLoggerByType() helper.

Output Formats

  • Console logger emits plain text via Winston's simple formatter.
  • JSON logger emits structured JSON with level and message, and includes any extra metadata fields passed to the logger methods.

Log level filtering follows standard Winston semantics: messages below the configured level are discarded.

Testing & Coverage

See the root instructions for details on running pnpm run test:coverage and accessing coverage artifacts.

API Reference

Generated API documentation is available in the logging API section.