This document is a work in progress. Having trouble upgrading to
winston@3.0.0-rc{X}
? Open an issue so we can improve this guide!
winston.Logger
has been replaced withwinston.createLogger
.winston.setLevels
has been removed. Levels are frozen at the time of Logger creation.- Setting the level on the default
winston
logger no longer sets the level on the transports associated with the defaultwinston
logger.
- Default output format is now
formats.json()
.
filters
: Use a customformat
.rewriters
: Use a customformat
.
stringify
: Use a customformat
.formatter
: Use a customformat
.json
: Useformats.json()
.raw
: Useformats.json()
.prettyPrint
: Useformats.prettyPrint()
or a customformat
.colorize
: Useformats.colorize()
.timestamp
: Useformats.timestamp()
.logstash
: Useformats.logstash()
.align
: Useformats.align()
.showLevel
: Use a customformat
.
winston.Logger
will no longer respond with an error when logging with no transportswinston.Logger
will no longer respond with an error if the same transports are added twice.Logger.prototype.stream
options.transport
is removed. Use the transport instance on the logger directly.
Logger.prototype.query
options.transport
is removed. Use the transport instance on the logger directly.
winston.exception
has been removed. Use:
const exception = winston.ExceptionHandler();
humanReadableUnhandledException
is now the default exception format..unhandleExceptions()
will no longer modify transports state, merely just add / remove theprocess.on('uncaughtException')
handler.- Call close on any explicit
ExceptionHandlers
. - Set
handleExceptions = false
on all transports.
- Call close on any explicit
winston.transports.Memory
was removed. Use any Node.jsstream.Writeable
with a largehighWaterMark
instance instead.- When writing transports use
winston-transport
instead ofwinston.Transport
winston.Container
instances no longer have defaultConsole
transportswinston.Container.prototype.add
no longer does crazy options parsing. Implementation inspired by segmentio/winston-logger
winston.hash
was removed.winston.common.pad
was removed.winston.common.serialized
was removed (usewinston-compat
).winston.common.log
was removed (usewinston-compat
).
winston-transport
abstract-winston-transport
logform