Query and streaming support #130

Merged
merged 72 commits into from May 31, 2012

Conversation

Projects
None yet
2 participants
Member

chjj commented May 4, 2012

This will add .stream and .query support to winston.

One problem with the additions to the transports in general was the inconsistencies between them. Some transports had json enabled by default, some did not. Some had timestamps enabled by default, others did not. Both of these features are pretty essential if the user ever wants to query logs. There was also some dissonance between property names, e.g. message vs. msg. In some cases, the log object was being mixed-in with the meta object before logging, in other cases it wasn't.

There's also the question of the core transports. winston-nssocket and winston-redis were moved here to ease development, but they feel kind of natural as core transports. winston-redis needed some work in areas, and it depended on a much older version of winston. "winston-http" was also added. Nothing like it existed prior. Both winston-nssocket and winston-http will be useful for communication with winstond.

The main thing lacking right now is the loggly transport. Loggly has been given stream/query support, but it is not as well tested as the other transports.

These changes should be compatible with existing winston transports. The logger.stream and logger.query methods only consider using a transport if it has these methods to begin with.

indexzero and others added some commits Oct 21, 2011

[api] First pass at `Logger.query` implementation.
Conflicts:

	lib/winston.js
	lib/winston/transports/transport.js
[api] Make transport.log callback execute on response.
This helps with testing a lot.

    logger.log('info', 'hello world', {}, function(err) {
      doOtherStuff();
    });

It is now possible to make the assumption that the callback will only be
executed once a response is received from the server.

@chjj chjj merged commit 8ddbcff into master May 31, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment