bithavoc / express-winston

express.js middleware for winstonjs
https://www.npmjs.com/package/express-winston
MIT License
797 stars 187 forks source link

log file is hard to read #122

Closed MinionsDave closed 7 years ago

MinionsDave commented 7 years ago

this is my code, and the version is 2.0.0 app.use(expressWinston.errorLogger({ transports: [ new winston.transports.Console({ json: true, colorize: true }), new winston.transports.File({ filename: 'logs/error.log' }) ] })); I open the error.log file in my vsc, I find it's hard to read, it's no indent and no line feed.

is there some options i need to config?

rosston commented 7 years ago

express-winston is mostly just glue between express and winston, so you're actually looking for winston settings in this case.

You're using the built-in File transport that winston provides. You can see all the possible settings for it here: https://github.com/winstonjs/winston/blob/master/docs/transports.md#file-transport. Looking at that link, there seem to be several settings to cover your use case.

MinionsDave commented 7 years ago

ok, thank you for response!