Java app, built with Gradle, implementing SLF4J and Logback, exporting with Logstash to Datadog agentless logging.
Can't seem to get the host, service, or source properties to transmit:
build.gradle
implementation 'ch.qos.logback:logback-classic:1.2.3'
implementation 'net.logstash.logback:logstash-logback-encoder:6.6'
implementation 'org.slf4j:log4j-over-slf4j:1.7.13'
implementation 'org.slf4j:slf4j-api:1.7.5'
logback.xml
Note where I've included the <host> and <service> tags. I also tried <property name=".." value=".."> and <KeyValuePair key="service" value="java-app" /> to no avail.
<appender name="JSON_TCP" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<remoteHost>intake.logs.datadoghq.com</remoteHost>
<service>my-favorite-service</service>
<host>${HOSTNAME}</host>
<port>10514</port>
<keepAliveDuration>20 seconds</keepAliveDuration>
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<prefix class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>abc123abc123abc123abc123abc123 %mdc{keyThatDoesNotExist}</pattern>
</layout>
</prefix>
</encoder>
</appender>
Docs
Here are the docs I'm reading from Datadog:
https://docs.datadoghq.com/logs/log_collection/java/?tab=log4j#agentless-logging
https://docs.datadoghq.com/tracing/connect_logs_and_traces/java?tab=log4j2
https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging/?tab=kubernetes
Also, the docs for logstash-logback-encoder itself states:
By default, each property of Logback's Context (ch.qos.logback.core.Context) will appear as a field in the LoggingEvent.
By default, each property of Logback's Context
(ch.qos.logback.core.Context)will appear as a field in the LoggingEvent.
So, how do I add a property to Logback's Context?

