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

Datadog formatter: Adding the log level to the root of the logged object #140

Open
Miradorn opened this issue Nov 6, 2024 · 2 comments
Open

Comments

@Miradorn
Copy link

Miradorn commented Nov 6, 2024

Hey there!

I'm trying to migrate our codebase from an old formatter to LoggerJson, using Datadog format since we're using Datadog for tracing and metrics. Unfortunately at this point we're not using datadog for log management but another solution.
This other solution doesn't extract log levels from the syslog field but expect a top-level level field.

Would it be possible to add the level to the top level?
I can't seem to see a way how it could be done currently, so I think my question is, would a MR be accepted that adds that field for the datadog formatter?

Thanks!

@AndrewDryga
Copy link
Member

Hello @Miradorn, you can copy-paste and modify the DataDog formatter to your codebase and modify it to your needs. Or you can check if the Basic formatter will better suit your needs.

@Miradorn
Copy link
Author

Hey! Yeah, I could do that!
I'd prefer using the library directly to keep getting updates if there are any without having to manage it myself :D
I tried using the datadog formatter since that one is the only one automatically translating otel-trace/span ids into the datadog format, something we need since our traces are on datadog and correlation doesn't work without it 😢

So these 2 combined made me wonder if adding the level as a root property would be reasonable. It's not really complete data duplication (the syslog.level field is mapping the values to syslog levels) and having a root level field seems reasonable to me at least, but if you're saying it doesn't make sense I understand that :D

thanks!

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

2 participants