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

Provide Environment Variable for setting `datadog.slf4j.simpleLogger.jsonEnabled` configuration

Open janjaali opened this issue 1 month ago • 6 comments

Library Name

No response

Library Version(s)

No response

Describe the feature you'd like

Provide the missing Environment Variable equivalent for setting datadog.slf4j.simpleLogger.jsonEnabled, see https://docs.datadoghq.com/tracing/trace_collection/library_config/java/#traces.

Is your feature request related to a problem?

No response

Describe alternatives you've considered

No response

Additional context

No response

janjaali avatar Nov 28 '25 14:11 janjaali

Support ticket request #2370306.

janjaali avatar Nov 28 '25 15:11 janjaali

We use env variable JDK_JAVA_OPTIONS with value -Ddatadog.slf4j.simpleLogger.jsonEnabled=true. But I would agree, having and env variable like almost all of the other agent config options have would be nice.

florianmutter avatar Dec 01 '25 09:12 florianmutter

Hi! How are you doing? @florianmutter, @janjaali, I’d like to know if this issue has already been assigned to someone. I’d love to contribute :)

brun0-4ugusto avatar Dec 05 '25 14:12 brun0-4ugusto

FYI, this is where it would be easiest to add such an environment variable: https://github.com/DataDog/dd-trace-java/blob/v1.56.1/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Agent.java#L1432

The recommended approach would be to query the environment variable and (if set) pass the value into the expected system property, like we do for the log level. That would avoid the need to change the logger internals.

mcculls avatar Dec 05 '25 14:12 mcculls

Hi @brun0-4ugusto, the latest reply on the support ticket was that this feature request was provided to product team backlog and that they will decide when to prioritize it - and if it will be prioritized at all. Florians workaround helped us to overcome our issue for the moment as workaround.

janjaali avatar Dec 05 '25 14:12 janjaali

@janjaali Nice! Thank you very much for the reply! If there’s any other issue I could contribute to, please let me know. I’m from Brazil and we use Datadog as our observability tool. I really like the platform and would love to contribute! Thank you so much.

brun0-4ugusto avatar Dec 05 '25 15:12 brun0-4ugusto