logtail-js
logtail-js copied to clipboard
Context is always the @logtail/pino file instead of the calling function
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": "..\\..\\..\\..\\@[email protected][email protected][email protected]\\node_modules\\@logtail\\pino\\dist\\cjs\\pino.js",
"function": "buildFunc",
"line": 61
},
"system": {
"main_file": "C:\\Users\\[PATH TO SOURCE]\\node_modules\\.pnpm\\[email protected]\\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.
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.
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 🚀