dd-trace-java icon indicating copy to clipboard operation
dd-trace-java copied to clipboard

dd.trace logs appearing in Datadog as errors

Open dan-lind opened this issue 3 years ago • 3 comments

I'm experiencing issues with where in my Datadog logs for a java service, I'm seeing dd.trace entries which are not being parsed and additionally are being categorized as errors. I've followed the in app setup for k8s and Java, and the Java logs are parsed just fine. It's the mixed in dd.trace logs that are causing issues, like this one.

[dd.trace 2022-06-29 08:28:03:684 +0000] [main] WARN com.datadog.appsec.powerwaf.PowerWAFModule - WAF has rule against unknown address grpc.server.request.metadata

I found this old issue where the last entry mentions setting up a custom parse rule, which seems to resolve the issue https://github.com/DataDog/dd-trace-java/issues/693#issuecomment-663042856

However this issue is quite old and I'm puzzled that this case isn't handled by default?

dan-lind avatar Jun 29 '22 12:06 dan-lind

Hi @dan-lind if you don't want tracer logging in your application logs then you can route it to a separate file with

-Ddatadog.slf4j.simpleLogger.logFile=path/to/tracer.log

(note: other SimpleLogger settings can be used with the tracer - just with datadog.slf4j.simpleLogger. as the prefix)

mcculls avatar Jun 29 '22 12:06 mcculls

I was more surprised by the fact that even though I followed all the docs, this case is not handled by default, and I even end up with error logs (which are not errors) by default. I think this should at least be mentioned somewhere in the docs. It took me quite some time to find that issue from 2019...

dan-lind avatar Jun 29 '22 13:06 dan-lind

Yes I agree, I'll pass on your feedback

mcculls avatar Jun 29 '22 13:06 mcculls

FYI for people looking at this issue, this thread/comment is really useful. https://github.com/DataDog/dd-trace-java/issues/1109#issuecomment-1590056133

SJrX avatar Oct 13 '23 21:10 SJrX

Closing in favor of https://github.com/DataDog/dd-trace-java/issues/1109

bm1549 avatar Nov 17 '23 22:11 bm1549