To enforce HTTPS transport with Agent versions v6.14+/v7.14+ , update the Agent’s main configuration file (datadog.yaml
) with:
logs_enabled: true
logs_config:
force_use_http: true
To send logs with environment variables, configure the following:
DD_LOGS_ENABLED=true
DD_LOGS_CONFIG_USE_HTTP=true
By default, the Datadog Agent uses the port 443
to send its logs to Datadog over HTTPS.
HTTPS transport
HTTPS log forwarding is the recommended configuration for the best log collection reliability as the200
status code is returned by the Datadog storage system:
Using HTTP, the Agent sends log batches with the following limits:
- Maximum batch size: 1MB
- Maximum size for a single log: 256kB
- Maximum number of logs in a batch: 1,000
Log compression
The compression_level
parameter (or DD_LOGS_CONFIG_COMPRESSION_LEVEL
) accepts values from 0
(no compression) to 9
(maximum compression but higher resource usage). The default value is 6
.
See the Datadog Agent overhead section for more information about Agent resource usage when compression is enabled.
For Agent versions prior to 6.19 / 7.19, you need to enforce compression by updating the Agent’s main configuration file (datadog.yaml
) with:
logs_enabled: true
logs_config:
use_http: true
use_compression: true
compression_level: 6
The Agent waits up to 5 seconds to fill each batch (either in content size or number of logs). Therefore, in the worst case scenario (when few logs are generated) switching to HTTPS might add a 5-second latency compared to the TCP transport which sends all logs in real time.
To change the maximum time the Datadog Agent waits to fill each batch, add the following configuration in the Agent’s main configuration file (datadog.yaml
):
logs_config:
batch_wait: 2
Or use the DD_LOGS_CONFIG_BATCH_WAIT=2
environment variable. The unit is in seconds and must be an integer between 1
and 10
.
HTTPS proxy configuration
When logs are sent through HTTPS, use the same set of proxy settings as the other data types to send logs through a web proxy.
To enforce TCP transport, update the Agent’s main configuration file (datadog.yaml
) with:
logs_enabled: true
logs_config:
force_use_tcp: true
To send logs with environment variables, configure the following:
DD_LOGS_ENABLED=true
DD_LOGS_CONFIG_FORCE_USE_TCP=true
By default, the Datadog Agent sends its logs to Datadog over TLS-encrypted TCP. This requires outbound communication (on port 10516
for Datadog US site and port 443
for Datadog EU site).