Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The callback of log(info, callback) was used in a wrong manner #87

Merged
merged 1 commit into from
May 12, 2019

Conversation

litti
Copy link
Contributor

@litti litti commented May 12, 2019

de6e51f introduced the wrong use of callback in log(info, callback) which lead to the following issues:

  • the @timestamp is wrong because the transformer is only called every 2 seconds by default (flushInterval for bulk write)
  • other transports are stopped for flushInterval because the callback isn't called

For further information about correct use of the callback please read https://github.com/winstonjs/winston/blob/master/lib/winston/logger.js

For tests please clone https://github.com/litti/test-winston-elasticsearch and change the version of winston-elasticsearch in package.json to 0.7.3, 0.7.4 and git+https://github.com/litti/winston-elasticsearch.git. After each change run node app.js. Watch the logs in console and the timestamps in your elastichsearch log.

…e6e51f which lead to the following issues:

- the @timestamp is wrong because the transformer is only called every 2 seconds by default (flushInterval for bulk write)
- other transports are stopped for flushInterval because the callback isn't called

For further information about correct use of the callback please read https://github.com/winstonjs/winston/blob/master/lib/winston/logger.js

For tests please clone https://github.com/litti/test-winston-elasticsearch and change the version of winston-elasticsearch in package.json to 0.7.3, 0.7.4 and git+https://github.com/litti/winston-elasticsearch.git. After each change run `node app.js`. Watch the logs in console and the timestamps in your elastichsearch log.
@vanthome vanthome merged commit d6ddb56 into vanthome:master May 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants