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

Save logs on separate Redis list based on their levels #6

Closed
wants to merge 1 commit into from

Conversation

diogogmt
Copy link

Instead of saving all logs in a single list they could be saved on separate lists and use the log's level to generate the key name.

@indexzero
Copy link
Member

@diogogmt This is wrong, but I understand what feature you need. On every call to .log() we attempt to coerce a string from the this.container function. Only the metadata is passed to this function, you want the level and msg passed as well.

I'm totally OK with this, just submit a different PR. Then you could do something like:

  var redisTransport = new require('winston-redis').Redis({
    container: function (level, msg, meta) {
      return 'OHAI:' + level;
    }
  });

@indexzero indexzero closed this Mar 18, 2013
@indexzero
Copy link
Member

The two lines in question are here FYI. https://github.com/indexzero/winston-redis/blob/master/lib/winston-redis.js#L81-L82

This will be a breaking change, but I like the direction it's going in so I'm fine with that.

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