-
Notifications
You must be signed in to change notification settings - Fork 295
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
Each error/log in Datadog is broken down into 1 entry for each line of the error stack instead of 1 error with a full log of the entire error stack. #1170
Comments
This library generates traces but doesn't handle logging outside of APM. For help regarding the Log Management product I would recommend contacting support or asking in the public Slack. Generally speaking, each line of the log output will becomes its own entry. |
Thank you for the Slack link :) Just to clarify, so with regards to the Datadog platform, this library only deals with the APM part? I was under the impression all views are based on the same data and I thought the way dd-trace-js emits the data (the format) plays a role in how the logs are shown everywhere. |
Yes, it's only the APM part. For the logs, they're either sent to the agent directly from the app using a transport on your logger of choice (for example winston) or sent to |
How does one do that? What's the "Source" ? |
I meant directly at the logger level in the service. What logger are you using? |
I think these logs are generated on the framework level so I'm not sure we have access to its' logging library/mechanism, but I just looked and they use https://www.npmjs.com/package/consola . Is there a way to add a logging middleware which handles these and converts them? Which logger should we use in general to send JSON format errors? |
Generally speaking we recommend using either Winston, Bunyan or Pino since they are the most popular loggers out there and also are supported for our log injection feature. I'm not familiar enough with Nuxt to know if it's best practice to provide your own logger or stick to Consola though. It does look like Consola has an available JSON reporter. Configuring it to use that reporter, at least in non-local environments, would definitely give you a better logging experience. I also created #1172 to track log injection support for Consola. |
awesome. I guess #1172 will solve our problem :-) |
#1172 is a different feature (being able to connect logs and traces together) but won't solve the multiple lines issue, which would still require altering the format as described above. |
I guess I won't be able to change the source code of the node module in question (the error is thrown in the frameworks context). Maybe I can catch it and relog / reformat it on our code |
Describe the bug
Each error/log in Datadog is broken down into 1 entry for each line of the error stack instead of 1 error with a full log of the entire error stack.
Environment
Production
Operation system:
Linux
Node version:
14.14
Tracer version:
Latest
Agent version:
The text was updated successfully, but these errors were encountered: