Skip to content

Commit d822ae8

Browse files
authored
Always output logging.googleapis.com/trace_sampled as true (#332)
1 parent aa1d23c commit d822ae8

File tree

1 file changed

+7
-1
lines changed
  • examples/instrumentation-quickstart/src/main/resources

1 file changed

+7
-1
lines changed

examples/instrumentation-quickstart/src/main/resources/log4j2.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
<Configuration status="WARN">
1818
<Appenders>
1919
<Console name="Console" target="SYSTEM_OUT">
20-
<!-- TODO(#331): output logging.googleapis.com/trace_sampled as a boolean -->
20+
<!-- TODO(#331): output logging.googleapis.com/trace_sampled based on trace_flags instead
21+
of hardcoding as true -->
2122
<!-- [START opentelemetry_instrumentation_setup_logging] -->
2223
<!-- Format JSON logs for the Cloud Logging agent
2324
https://cloud.google.com/logging/docs/structured-logging#special-payload-fields -->
@@ -37,6 +38,11 @@
3738
format="JSON"
3839
value='{"$resolver": "mdc", "key": "span_id"}'
3940
/>
41+
<EventTemplateAdditionalField
42+
key="logging.googleapis.com/trace_sampled"
43+
format="JSON"
44+
value="true"
45+
/>
4046
</JsonTemplateLayout>
4147
<!-- [END opentelemetry_instrumentation_setup_logging] -->
4248
</Console>

0 commit comments

Comments
 (0)