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

Fix Timestamp Handling for Logstash and Default to True #16

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

joshelson
Copy link

No description provided.

@cthayer
Copy link

cthayer commented Jul 10, 2017

Adding timestamps to the log event objects is something that winston does.

You can enable them by doing this:

var winston = require('winston'),
        LogstashUDP = require('winston-logstash-udp').LogstashUDP;

    var logger = new(winston.Logger)({
      transports: [
        new(LogstashUDP)({
          port: 9999,
          appName: 'my application name',
          host: '127.0.0.1',
          timestamp: true  // enable timestamps
        })
      ]
    });

It is intentional that winston's default behavior (no timestamps) is being preserved by this transport. Plus, I don't think that we should change the default behavior at this point as that breaks backwards compatibility.

@joshelson
Copy link
Author

joshelson commented Jul 10, 2017

I don't believe the timestamp actually propagated with timestamp: true in that configuration. It was never passed up via the options stack.

Could certainly default it to false if that made more sense.

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