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

LegacyTransportStream passes info as meta #27

Open
markdascher opened this issue Jun 28, 2018 · 4 comments
Open

LegacyTransportStream passes info as meta #27

markdascher opened this issue Jun 28, 2018 · 4 comments

Comments

@markdascher
Copy link

In a v2 transport, my understanding was that meta was something different from the message. (i.e. logger.info('hello world', { happy: true });) As an example, winston-papertrail sends extra JSON-formatted messages if there's a meta object. LegacyTransportStream just passes info here, which isn't really the same thing. The end result is that winston 3 ends up sending two messages for each log, one of them in JSON.

Should LegacyTransportStream be doing some interpretation of info, similar to the simple logform? Then it would only pass an object if there's more than just a level and message, which might make more sense to v2 transports.

Honestly it's tough to figure out exactly what the v3 equivalent of meta is (staring at winstonjs/winston#1235 hasn't helped), so this all could be a misunderstanding on my part too.

@kazazes
Copy link

kazazes commented Aug 24, 2018

@markdascher, if you strip level, message and [LEVEL] from info, you’re left with the equivalent of meta.

@markdascher
Copy link
Author

Would a PR that makes LegacyTransportStream do that be welcome?

@kazazes
Copy link

kazazes commented Aug 30, 2018

@markdascher I've submitted a PR adding Winston 3.0 support to the Google Stackdriver transport, which is stuck on 2.4.4.

Your suggestion would help...

@chimmelb
Copy link

@kazazes Your comment from long ago, "if you strip level, message and [LEVEL] from info" - does that need to be done in the transport itself? Or can it be done outside the transport in a custom winston.format() or someplace else?

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

No branches or pull requests

3 participants