This library provides a preconfigured winston logger that can be used in any typescript or node project it is based on winston3.
- Node v10 or greater, NPM v6.4.1
npm install winston @strg/logging-winstonimport {logger} from '@strg/logging-winston'
logger.info(`${'hello world'}`)For all errors with a parent "cause", messages and stacktrace will be displayed hierarchically.
const error = new Error('Child Error', { cause: new Error('Parent Error')})
logger.error(error) // will display stacktrace and original message for child and parent errors| Description | Default | |
|---|---|---|
| NODE_LOG_FORMAT | SIMPLE, JSON |
JSON |
| NODE_LOG_LEVEL | fatal, error, warn, info, trace, debug |
info |
| NODE_LOG_STACK_KEY | the key of the stacktrace (require NODE_LOG_FORMAT=JSON) |
stack_trace |
This library aims to standarize the logging output in all node or typescript based applications.
#TBD
#TBD
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Nils Müller - implementation