https://signoz.io logo
#general
Title
# general
h

Harald Fielker

03/17/2023, 5:17 PM
Is there a way in the logger to put custom fields to the detail view? I am using NodeJS/winson (just for fun).
Copy code
const extra = { extra : { duno: "foo", whatever: "bar" } };

app.listen(port, () => {
  logger.log('info', 'Example app listening at <http://localhost>:%d', port, extra);
});
image.png
Is there a way to extract this or let my use it in queries?
in DDog I used to put in here stuff like the
batch_id
or a
customer_id
which makes it easy to debug
h

Harald Fielker

03/17/2023, 6:02 PM
s

Srikanth Chekuri

03/17/2023, 6:03 PM
Yes, that will help for injecting trace context which will help in correlation
h

Harald Fielker

03/17/2023, 6:03 PM
or does this only work, because trace_id, span_id and trace_flags is already part of the collector ?
btw. I have no issue just talking to the collector via IP - metrics already need this hack
s

Srikanth Chekuri

03/17/2023, 6:04 PM
As you can see from the description, it is your winston logger + trace context injected.
h

Harald Fielker

03/17/2023, 6:08 PM
I think this just adds the 3 fields to
<http://logger.info|logger.info>( ...
ok -check-
I go with the userguide you send me 🙂