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

JSON being appended to the end of the log #85

Open
shortcircuit3 opened this issue Dec 20, 2018 · 9 comments
Open

JSON being appended to the end of the log #85

shortcircuit3 opened this issue Dec 20, 2018 · 9 comments

Comments

@shortcircuit3
Copy link

image

How do I get rid of the extra log object?

@andrewryan1906
Copy link

Bump.... great library btw... would love to know how to fix this as well?

@ZacharyDraper
Copy link

ZacharyDraper commented Jan 20, 2019

This is due to the changes in Winston v3. The new version in the works in the v2 branch by @ffxsam resolves it.

@thebarty
Copy link

thebarty commented Oct 1, 2019

Still exists. Same problem over here. passing inlineMeta: true makes it a bit more readable, but it still sucks

@oto-ledger
Copy link

oto-ledger commented Jan 12, 2020

I've made few changes on my side, to fix that issue:

in function Papertrail.prototype.log
-    if (meta) {
+    if (meta && false) {

This way, the meta information are not appended to the log. It's quite an ugly fix, but the winston v3 change left no other option :(
If anyone has a better idea, i'll be delighted to give up that ugly hack

@nomandstrct
Copy link

any update on this

@markdascher
Copy link
Collaborator

Winston v3 includes pretty thorough built-in syslog support. Try using these instructions to switch to one of the new transports (either Syslog or Http).

@nomandstrct
Copy link

@markdascher you are doing the greatest job. But is there any way we can just remove this meta from logging

@markdascher
Copy link
Collaborator

Not that I'm aware of. Winston v3 broke backward compatibility due to this bug, which doesn't seem like it'll ever be fixed: winstonjs/winston-transport#27

That's why we've started recommending the v3 transports mentioned above, when using Winston v3 with Papertrail.

@nomandstrct
Copy link

nomandstrct commented Aug 9, 2024

worst work around

new Papertrail({
            ...configService.get('papertrail'),
            inlineMeta: true,
            logFormat(level, message) {
              let cleanMessage = message.replace(/\s*{\s*context:.*[^']/g, '');
              cleanMessage = cleanMessage.replace(/\s*{\s*message:.*[^']/g, '');

              return cleanMessage.trim();
            },
          }),

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

7 participants