Created
July 27, 2018 07:24
-
-
Save chris-peng-1244/6bb7e2976c6829ec75ff0b78ef804389 to your computer and use it in GitHub Desktop.
Default winston logger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {createLogger, format, transports } from 'winston'; | |
| const {combine, timestamp, prettyPrint } = format; | |
| const logger = createLogger({ | |
| format: combine( | |
| timestamp(), | |
| prettyPrint() | |
| ), | |
| transports: [ | |
| new transports.File({ | |
| filename: 'error.log' | |
| }), | |
| ] | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment