Skip to content

Commit 767a1df

Browse files
committed
Enable log injection by default
1 parent 3e676f4 commit 767a1df

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ If your Lambda function powers a performance-critical task (e.g., a consumer-fac
8585

8686
- DD_FLUSH_TO_LOG
8787

88-
To connect logs and traces, set the environment variable below to `True`. The default format of the AWS provided `LambdaLoggerHandler` will be overridden to inject `dd.trace_id` and `dd.span_id`. The default Datadog lambda log integration pipeline will automatically parse them and map the `dd.trace_id` into the reserved [trace_id attribute](https://docs.datadoghq.com/logs/processing/#trace-id-attribute).
88+
To connect logs and traces, set the environment variable below to `True`. The default format of the AWS provided `LambdaLoggerHandler` will be overridden to inject `dd.trace_id` and `dd.span_id`. The default Datadog lambda log integration pipeline will automatically parse them and map the `dd.trace_id` into the reserved [trace_id attribute](https://docs.datadoghq.com/logs/processing/#trace-id-attribute). Defaults to true.
8989

9090
- DD_LOGS_INJECTION
9191

datadog_lambda/wrapper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ class _LambdaDecorator(object):
4747
def __init__(self, func):
4848
self.func = func
4949
self.flush_to_log = os.environ.get("DD_FLUSH_TO_LOG", "").lower() == "true"
50-
self.logs_injection = os.environ.get("DD_LOGS_INJECTION", "").lower() == "true"
50+
self.logs_injection = (
51+
os.environ.get("DD_LOGS_INJECTION", "true").lower() == "true"
52+
)
5153

5254
# Inject trace correlation ids to logs
5355
if self.logs_injection:

0 commit comments

Comments
 (0)