A JSON and console formatter for winston@3, version 0.10.0. Enables structured logging with configurable output formats (JSON or console) and automatic hostname detection. Supports direct error object logging, custom metadata, and environment-based format switching via NODE_ENV. Released under ISC license, maintained on GitHub by amida-tech. Differentiates from other formatters by offering a simple configuration interface inspired by winston's format system, though it uses the legacy `logger.format` assignment rather than the modern `format` pipeline.
npm install winston-json-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up a Winston logger with JSON formatting using winston-json-formatter, demonstrating basic logging and error object handling.
Use import syntax or dynamic import().
Set logger.format = configuredFormatter(options) directly.
Set NODE_ENV to production or another value to use JSON format.
Use the upper-case environment variable NODE_ENV instead.
npm install winston-json-formatter && use import configuredFormatter from 'winston-json-formatter'.
Change to import configuredFormatter from 'winston-json-formatter'.
Set logger.format = configuredFormatter(options) before any logging calls.