Skip to content

Instantly share code, notes, and snippets.

@chris-peng-1244
Created July 27, 2018 07:24
Show Gist options
  • Select an option

  • Save chris-peng-1244/6bb7e2976c6829ec75ff0b78ef804389 to your computer and use it in GitHub Desktop.

Select an option

Save chris-peng-1244/6bb7e2976c6829ec75ff0b78ef804389 to your computer and use it in GitHub Desktop.
Default winston logger
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