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

Context is always the @logtail/pino file instead of the calling function #124

Closed
TheSecurityDev opened this issue Sep 21, 2024 · 2 comments · Fixed by #127
Closed

Context is always the @logtail/pino file instead of the calling function #124

TheSecurityDev opened this issue Sep 21, 2024 · 2 comments · Fixed by #127

Comments

@TheSecurityDev
Copy link

TheSecurityDev commented Sep 21, 2024

Every log message has a "context" object that's supposed to contain info about where the log was called from. But it seems to always be the same value, so it isn't useful information and just wastes space. I'm not sure if there's any way to remove this data either.

Context object:

    {
        "runtime": {
            "column": 25,
            "file": "..\\..\\..\\..\\@logtail+pino@0.5.0_encoding@0.1.13_pino@9.4.0\\node_modules\\@logtail\\pino\\dist\\cjs\\pino.js",
            "function": "buildFunc",
            "line": 61
        },
        "system": {
            "main_file": "C:\\Users\\[PATH TO SOURCE]\\node_modules\\.pnpm\\thread-stream@3.1.0\\node_modules\\thread-stream\\lib\\worker.js",
            "pid": 38904
        }
    }

This is for the @logtail/pino module specifically, but I tried copying it and modifying the stackFrameHint, but I can't seem to get it to do anything other than log the transport file. It might be an issue with how the @logtail/node module gets the stack frame.

@curusarn
Copy link
Contributor

Hey @TheSecurityDev,

Thank you for raising this!
This definitely shouldn't happen.

I'm forwarding this to the team to get this fixed.
We'll keep you up to date here in GitHub.

Thanks again for reporting this.

@PetrHeinz
Copy link
Member

Hi @TheSecurityDev,

Thanks again for raising this 🙌

Unfortunately due to how Pino runs the transport code, it's not possible to add relevant context the same way. We've decided to omit the context altogether in Pino.

We've released the new version as v0.5.2 🚀

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 a pull request may close this issue.

3 participants