From 3b34a569d2e391ab97f215d71223373ed92af655 Mon Sep 17 00:00:00 2001 From: Max Phillips Date: Thu, 30 Jul 2026 16:38:08 -0500 Subject: [PATCH 1/7] Restructure AWS service logs support matrix Merge the separate service-logging and autosubscription tables into a single per-service matrix with log source, storage, automatic collection, and setup columns. Add FSx, OpenSearch, Transit Gateway, and Bedrock. Move DynamoDB, EC2, and SNS into a section for services collected through another method. Fix the duplicate reference definitions and the broken ECS log link. --- ...s-logs-with-the-datadog-lambda-function.md | 173 ++++++++---------- 1 file changed, 75 insertions(+), 98 deletions(-) diff --git a/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md b/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md index b8b655772ab..a3958dff267 100644 --- a/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md +++ b/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md @@ -27,53 +27,79 @@ AWS service logs can be collected with the Datadog Forwarder Lambda function. Th To start collecting logs from your AWS services: 1. Set up the [Datadog Forwarder Lambda function][1] in your AWS account. -2. [Enable logging](#enable-logging-for-your-aws-service) for your AWS service (most AWS services can log to a S3 bucket or CloudWatch Log Group). +2. [Enable logging](#supported-aws-services) for your AWS service (most AWS services can log to a S3 bucket or CloudWatch Log Group). 3. [Set up the triggers](#set-up-triggers) that cause the Forwarder Lambda to execute when there are new logs to be forwarded. There are two ways to configure the triggers. **Notes**: - You can use [AWS PrivateLink][2] to send your logs over a private connection. - CloudFormation creates an IAM policy which includes `KMS:Decrypt` for all resources, and does not align with AWS Security Hub's best practice. This permission is used to decrypt objects from KMS-encrypted S3 buckets to set up the Lambda function, and the KMS key used to encrypt the S3 buckets cannot be predicted. You can safely delete this permission after the installation finishes successfully. -## Enable logging for your AWS service - -Any AWS service that generates logs into a S3 bucket or a CloudWatch Log Group is supported. Find setup instructions for the most used services in the table below: - -| AWS service | Activate AWS service logging | Send AWS logs to Datadog | -| ---------------------------------- | -------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | -| [API Gateway][3] | [Enable Amazon API Gateway logs][4] | [Manual][5] and [automatic](#automatically-set-up-triggers) log collection. | -| [AppSync][64] | [Enable AWS AppSync Logs][65] | [Manual][65] and [automatic](#automatically-set-up-triggers) log collection. | -| Batch | `-` | [Automatic](#automatically-set-up-triggers) log collection. | -| [Bedrock Agentcore][74] | `-` | [Automatic](#automatically-set-up-triggers) log collection. | -| [Cloudfront][6] | [Enable Amazon CloudFront logs][7] | [Manual][8] and [automatic](#automatically-set-up-triggers) log collection. | -| [CloudTrail][9] | [Enable AWS CloudTrail logs][9] | [Manual][10] and [automatic](#automatically-set-up-triggers) log collection. See [AWS Configuration for Cloud SIEM][11] if you are setting up AWS CloudTrail for Cloud SIEM. | -| [CodeBuild][66] | [Enable AWS CodeBuild logs][67] | [Manual][67] and [automatic](#automatically-set-up-triggers) log collection. | -| [DMS][68] | [Enable AWS Database Migration Service logs][69] | [Manual][69] and [automatic](#automatically-set-up-triggers) log collection. | -| [DocumentDB][70] | [Enable Amazon DocumentDB logs][71] | [Manual][71] and [automatic](#automatically-set-up-triggers) log collection. | -| [DynamoDB][12] | [Enable Amazon DynamoDB logs][13] | [Manual][14] log collection. | -| [EC2][15] | `-` | Use the [Datadog Agent][15] to send your logs to Datadog. | -| [ECS][16] | `-` | [Use the Docker Agent to gather your logs][17] or [automatic](#automatically-set-up-triggers) log collection. | -| [EKS][62] | [Enable Amazon EKS logs][63] | [Manual][63] and [automatic](#automatically-set-up-triggers) log collection. | -| [Elastic Load Balancing (ELB)][18] | [Enable Amazon ELB logs][19] | [Manual][20] and [automatic](#automatically-set-up-triggers) log collection. | -| [Glue][76] | [Enable AWS Glue logs][77] | [Manual][77] and [automatic](#automatically-set-up-triggers) log collection. | -| [IoT Core][74] | [Enable Amazon IoT Core logs][75] | [Automatic](#automatically-set-up-triggers) log collection. | -| [Lambda][21] | `-` | [Manual][22] and [automatic](#automatically-set-up-triggers) log collection. | -| [MWAA][55] | [Enable Amazon MWAA logs][56] | [Manual][56] and [automatic](#automatically-set-up-triggers) log collection. | -| [Network Firewall][57] | [Enable AWS Network Firewall logs][58] | [Manual][58] and [automatic](#automatically-set-up-triggers) log collection. | -| [PCS][75] | `-` | [Automatic](#automatically-set-up-triggers) log collection. | -| [RDS][23] | [Enable Amazon RDS logs][24] | [Manual][25] log collection. | -| [RedShift][34] | [Enable Amazon Redshift logs][35] | [Manual][36] and [automatic](#automatically-set-up-triggers) log collection. | -| Redshift Serverless | `-` | [Automatic](#automatically-set-up-triggers) log collection. | -| [Route 53][59] | Enable Amazon Route 53 [DNS query logging][60] and [resolver query logging][73] | [Manual][61] and [automatic](#automatically-set-up-triggers) log collection. | -| [S3][29] | [Enable Amazon S3 logs][30] | [Manual][31] and [automatic](#automatically-set-up-triggers) log collection. | -| [SNS][32] | SNS does not provide logs, but you can process logs and events that are transiting through to the SNS Service. | [Manual][33] log collection. | -| SSM | `-` | [Automatic](#automatically-set-up-triggers) log collection. | -| [Step Functions][52] | [Enable Amazon Step Functions logs][53] | [Manual][54] log collection. | -| [Verified Access][37] | [Enable Verified Access logs][38] | [Manual][39] and [automatic](#automatically-set-up-triggers) log collection. | -| [VPC][40] | [Enable Amazon VPC logs][41] | [Manual][42] and [automatic](#automatically-set-up-triggers) log collection. | -| [VPN][26] | [Enable AWS VPN logs][72] | [Manual][27] and [automatic](#automatically-set-up-triggers) log collection. | -| [Web Application Firewall][49] | [Enable AWS WAF logs][50] | [Manual][51] and [automatic](#automatically-set-up-triggers) log collection. | +## Supported AWS services + +Any AWS service that generates logs into a S3 bucket or a CloudWatch Log Group is supported. The following table lists the services collected with the Datadog Forwarder Lambda function: + +- **Log source**: The `source` tag Datadog applies to the logs. Use it to find your logs in the [Log Explorer][45]. +- **Storage**: Where the AWS service can write logs that the Forwarder collects. +- **Automatic collection**: Whether Datadog can [automatically set up the triggers](#automatically-set-up-triggers) for that log source. If not, [set up the triggers manually](#manually-set-up-triggers). +- **Setup**: Service-specific instructions for enabling logging and sending logs to Datadog. + +A `-` indicates that no additional setup step applies. + +| AWS service | Log source | Storage | Automatic collection | Setup | +| ---------------------------------- | ----------------------------- | -------------- | -------------------- | -------------------- | +| [API Gateway][3] | `source:apigateway` | CloudWatch, S3 | Yes | [Log collection][4] | +| [AppSync][64] | `source:appsync` | CloudWatch | Yes | [Log collection][65] | +| Batch | `source:batch` | CloudWatch | Yes | `-` | +| [Bedrock][78] | `source:bedrock` | CloudWatch, S3 | No | `-` | +| Bedrock Agentcore | `source:bedrock-agentcore` | CloudWatch, S3 | Yes | `-` | +| [CloudFront][6] | `source:cloudfront` | CloudWatch, S3 | Yes | [Log collection][7] | +| [CloudTrail][9] | `source:cloudtrail` | CloudWatch, S3 | Yes | [Log collection][10] | +| [CodeBuild][66] | `source:codebuild` | CloudWatch, S3 | Yes | [Log collection][67] | +| [DMS][68] | `source:dms` | CloudWatch, S3 | Yes | [Log collection][69] | +| [DocumentDB][70] | `source:docdb` | CloudWatch, S3 | Yes | [Log collection][71] | +| [ECS][16] | `source:ecs` | CloudWatch | Yes | [Log collection][17] | +| [EKS][62] | `source:eks` 1 | CloudWatch | Yes | [Log collection][63] | +| [Elastic Load Balancing (ELB)][18] | `source:elb` | CloudWatch, S3 | Yes | [Log collection][19] | +| [FSx][80] | `source:aws.fsx` | CloudWatch, S3 | No | [Log collection][81] | +| [Glue][76] | `source:glue` | CloudWatch, S3 | Yes | [Log collection][77] | +| [IoT][74] | `source:iot` | CloudWatch | Partial 2 | [Log collection][75] | +| [Lambda][21] | `source:lambda` | CloudWatch | Yes | [Log collection][22] | +| Lambda@Edge | `source:lambda` | CloudWatch | Yes | `-` | +| [MWAA][55] | `source:mwaa` | CloudWatch | Yes | [Log collection][56] | +| [Network Firewall][57] | `source:network-firewall` | CloudWatch, S3 | Yes | [Log collection][58] | +| [OpenSearch][82] | `source:opensearch` | CloudWatch | No | [Log collection][83] | +| [PCS][79] | `source:pcs` | CloudWatch | Partial 3 | `-` | +| [RDS][23] | `source:rds` 4 | CloudWatch | Yes | [Log collection][24] | +| [Redshift][34] | `source:redshift` | CloudWatch, S3 | Yes | [Log collection][36] | +| Redshift Serverless | `source:redshift-serverless` | CloudWatch | Yes | `-` | +| [Route 53][59] | `source:route53` 5 | CloudWatch | Yes | [Log collection][61] | +| [S3][29] | `source:s3` | S3 | Yes | [Log collection][30] | +| SSM | `source:ssm` | CloudWatch | Yes | `-` | +| [Step Functions][52] | `source:stepfunction` | CloudWatch | Yes | [Log collection][53] | +| [Transit Gateway][84] | `source:transitgateway` | CloudWatch, S3 | No | [Log collection][85] | +| [Verified Access][37] | `source:verified-access` | CloudWatch, S3 | Yes | [Log collection][39] | +| [VPC][40] | `source:vpc` | CloudWatch, S3 | Yes | [Log collection][42] | +| [VPN][26] | `source:vpn` | CloudWatch, S3 | Yes 6 | [Log collection][27] | +| [Web Application Firewall][49] | `source:waf` | S3 | Yes | [Log collection][50] | + +1 EKS control plane logs also use the `kubernetes.audit`, `kube-scheduler`, `kube-apiserver`, `kube-controller-manager`, and `aws-iam-authenticator` sources.
+2 Automatic collection for IoT is available at the account level only.
+3 Automatic collection for PCS is available for CloudWatch log groups only.
+4 RDS engine logs also use the `postgresql`, `mariadb`, and `mysql` sources.
+5 Covers both DNS query logs and Resolver query logs.
+6 Automatic collection is available for CloudWatch log groups. For S3 buckets, [set up the trigger manually](#collecting-logs-from-s3-buckets). +**Note**: [Subscription filters][48] are automatically created on CloudWatch log groups by the DatadogForwarder, and are named in the format `DD_LOG_SUBSCRIPTION_FILTER_`. + +### Services collected through another method + +The following AWS services are supported for log collection, but do not use the Datadog Forwarder Lambda function in the same way: +| AWS service | How logs are collected | +| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| [DynamoDB][13] | DynamoDB does not generate its own logs. API activity is captured through CloudTrail. See [Send logs to Datadog][14]. | +| [EC2][15] | Use the [Datadog Agent][15] to send your logs to Datadog. | +| [SNS][32] | SNS does not provide logs, but you can process logs and events that are transiting through to the SNS service. See [Send logs to Datadog][33]. | ## Set up triggers @@ -86,46 +112,7 @@ There are two options when configuring triggers on the Datadog Forwarder Lambda Datadog can automatically configure triggers on the Datadog Forwarder Lambda function to collect AWS logs. However, automatic subscription does not support creating triggers across different AWS accounts or regions. For scenarios where logs are published to S3 buckets in a separate account, we recommend manually creating a trigger in the same account as the bucket to work around this limitation. -The following sources and locations are supported: - -| Source | Location | -| --------------------------- | -------------- | -| Apache Airflow (MWAA) | CloudWatch | -| API Gateway Access Logs | CloudWatch | -| API Gateway Execution Logs | CloudWatch | -| Application ELB Access Logs | S3 | -| AppSync Logs | CloudWatch | -| Batch | CloudWatch | -| Bedrock Agentcore Logs | S3, CloudWatch | -| Classic ELB Access Logs | S3 | -| CloudFront Access Logs | S3 | -| Cloudtrail Logs | S3, CloudWatch | -| CodeBuild Logs | S3, CloudWatch | -| DMS Logs | CloudWatch | -| DocumentDB Logs | CloudWatch | -| ECS Logs | CloudWatch | -| EKS Control Plane Logs | CloudWatch | -| EKS Container Insights Logs | CloudWatch | -| Glue Jobs Logs | CloudWatch | -| Lambda Logs | CloudWatch | -| Lambda@Edge Logs | Cloudwatch | -| IoT Core Logs | CloudWatch | -| Network Firewall Logs | S3, CloudWatch | -| PCS Logs | CloudWatch | -| Redshift Logs | S3, Cloudwatch | -| Redshift Serverless Logs | CloudWatch | -| RDS Logs | CloudWatch | -| Route53 DNS Query Logs | CloudWatch | -| Route53 Resolver query Logs | S3, CloudWatch | -| S3 Access Logs | S3 | -| SSM Command Logs | CloudWatch | -| Step Functions | CloudWatch | -| Verified Access Logs | S3, CloudWatch | -| VPC Flow Logs | S3, CloudWatch | -| VPN Logs | CloudWatch | -| Web Application Firewall | S3, CloudWatch | - -**Note**: [Subscription filters][48] are automatically created on CloudWatch log groups by the DatadogForwarder, and are named in the format `DD_LOG_SUBSCRIPTION_FILTER_`. +To see which services support automatic collection, and the storage locations they support, see [Supported AWS services](#supported-aws-services). 1. If you haven't already, set up the [Datadog log collection AWS Lambda function][1]. 2. Ensure the policy of the IAM role used for [Datadog-AWS integration][43] has the following permissions. Information on how these permissions are used can be found in the descriptions below: @@ -396,43 +383,32 @@ You can also exclude or send only those logs that match a specific pattern by us [2]: /serverless/forwarder#aws-privatelink-support [3]: /integrations/amazon_api_gateway/ [4]: /integrations/amazon_api_gateway/#log-collection -[5]: /integrations/amazon_api_gateway/#send-logs-to-datadog [6]: /integrations/amazon_cloudfront/ [7]: /integrations/amazon_cloudfront/#enable-cloudfront-logging -[8]: /integrations/amazon_cloudfront/#send-logs-to-datadog [9]: /integrations/amazon_cloudtrail/#enable-cloudtrail-logging [10]: /integrations/amazon_cloudtrail/#send-logs-to-datadog -[11]: /security/cloud_siem/guide/aws-config-guide-for-cloud-siem/ -[12]: /integrations/amazon_dynamodb/#enable-dynamodb-logging [13]: /integrations/amazon_dynamodb/ [14]: /integrations/amazon_dynamodb/#send-logs-to-datadog [15]: /integrations/amazon_ec2/ [16]: /integrations/amazon_ecs/ -[17]: /integrations/amazon_ecs/#log-collection +[17]: /containers/amazon_ecs/logs/ [18]: /integrations/amazon_elb/ [19]: /integrations/amazon_elb/#enable-aws-elb-logging -[20]: /integrations/amazon_elb/#manual-installation-steps [21]: /integrations/amazon_lambda/ [22]: /integrations/amazon_lambda/#log-collection [23]: /integrations/amazon_rds/ [24]: /integrations/amazon_rds/#enable-rds-logging -[25]: /integrations/amazon_rds/#send-logs-to-datadog [26]: /integrations/amazon-vpn/ [27]: /integrations/amazon-vpn/#send-logs-to-datadog -[28]: /integrations/amazon_route53/#send-logs-to-datadog [29]: /integrations/amazon_s3/ [30]: /integrations/amazon_s3/#enable-s3-access-logs -[31]: /integrations/amazon_s3/#manual-installation-steps [32]: /integrations/amazon_sns/ [33]: /integrations/amazon_sns/#send-logs-to-datadog [34]: /integrations/amazon_redshift/ -[35]: /integrations/amazon-redshift/#enable-logging [36]: /integrations/amazon-redshift/#log-collection [37]: /integrations/amazon-verified-access/ -[38]: /integrations/amazon-verified-access/#enable-verified-access-logs [39]: /integrations/amazon-verified-access/#log-collection [40]: /integrations/amazon_vpc/ -[41]: /integrations/amazon_vpc/#enable-vpc-flow-log-logging [42]: /integrations/amazon_vpc/#log-collection [43]: /integrations/amazon_web_services/ [44]: https://app.datadoghq.com/integrations/amazon-web-services @@ -442,16 +418,13 @@ You can also exclude or send only those logs that match a specific pattern by us [48]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters [49]: /integrations/amazon_waf/ [50]: /integrations/amazon_waf/#log-collection -[51]: /integrations/amazon_waf/#send-logs-to-datadog [52]: /integrations/amazon_step_functions/ [53]: /integrations/amazon_step_functions/#log-collection -[54]: /integrations/amazon_step_functions/#send-logs-to-datadog [55]: /integrations/amazon_mwaa/ [56]: /integrations/amazon_mwaa/#log-collection [57]: /integrations/amazon_network_firewall/ [58]: /integrations/amazon_network_firewall/#log-collection [59]: /integrations/amazon_route53/ -[60]: /integrations/amazon_route53/#enable-route53-dns-query-logging [61]: /integrations/amazon_route53/#send-logs-to-datadog [62]: /integrations/amazon-eks/ [63]: /integrations/amazon-eks/#log-collection @@ -463,11 +436,15 @@ You can also exclude or send only those logs that match a specific pattern by us [69]: /integrations/amazon-dms/#send-logs-to-datadog [70]: /integrations/amazon-documentdb/ [71]: /integrations/amazon-documentdb/#send-logs-to-datadog -[72]: /integrations/amazon-vpn/#enable-logging -[73]: /integrations/amazon_route53/#enable-route53-resolver-query-logging [74]: /integrations/amazon-iot/ [75]: /integrations/amazon-iot/#enable-logging -[74]: /integrations/amazon-bedrock/ -[75]: /integrations/amazon-pcs/ [76]: /integrations/amazon_glue/ [77]: /integrations/amazon_glue/#log-collection +[78]: /integrations/amazon-bedrock/ +[79]: /integrations/amazon-pcs/ +[80]: /integrations/amazon_fsx/ +[81]: /integrations/amazon_fsx/#log-collection +[82]: /integrations/amazon_es/ +[83]: /integrations/amazon_es/#log-collection +[84]: /integrations/amazon_transit_gateway/ +[85]: /integrations/amazon_transit_gateway/#log-collection From 4e6f6f1ac96f611b1f1ec05e70c7807984e27f4e Mon Sep 17 00:00:00 2001 From: Max Phillips Date: Thu, 30 Jul 2026 16:58:52 -0500 Subject: [PATCH 2/7] Remove redundant Setup column from AWS log support matrix Link each service name directly to its log collection instructions instead of carrying a separate Setup column that was a link or a dash. Renumber reference links and repoint three stale anchors to the Log collection sections on the CloudFront, ELB, and RDS pages. --- ...s-logs-with-the-datadog-lambda-function.md | 206 ++++++++---------- 1 file changed, 89 insertions(+), 117 deletions(-) diff --git a/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md b/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md index a3958dff267..902988931d9 100644 --- a/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md +++ b/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md @@ -38,49 +38,48 @@ To start collecting logs from your AWS services: Any AWS service that generates logs into a S3 bucket or a CloudWatch Log Group is supported. The following table lists the services collected with the Datadog Forwarder Lambda function: -- **Log source**: The `source` tag Datadog applies to the logs. Use it to find your logs in the [Log Explorer][45]. +- **Log source**: The `source` tag Datadog applies to the logs. Use it to find your logs in the [Log Explorer][39]. - **Storage**: Where the AWS service can write logs that the Forwarder collects. - **Automatic collection**: Whether Datadog can [automatically set up the triggers](#automatically-set-up-triggers) for that log source. If not, [set up the triggers manually](#manually-set-up-triggers). -- **Setup**: Service-specific instructions for enabling logging and sending logs to Datadog. - -A `-` indicates that no additional setup step applies. - -| AWS service | Log source | Storage | Automatic collection | Setup | -| ---------------------------------- | ----------------------------- | -------------- | -------------------- | -------------------- | -| [API Gateway][3] | `source:apigateway` | CloudWatch, S3 | Yes | [Log collection][4] | -| [AppSync][64] | `source:appsync` | CloudWatch | Yes | [Log collection][65] | -| Batch | `source:batch` | CloudWatch | Yes | `-` | -| [Bedrock][78] | `source:bedrock` | CloudWatch, S3 | No | `-` | -| Bedrock Agentcore | `source:bedrock-agentcore` | CloudWatch, S3 | Yes | `-` | -| [CloudFront][6] | `source:cloudfront` | CloudWatch, S3 | Yes | [Log collection][7] | -| [CloudTrail][9] | `source:cloudtrail` | CloudWatch, S3 | Yes | [Log collection][10] | -| [CodeBuild][66] | `source:codebuild` | CloudWatch, S3 | Yes | [Log collection][67] | -| [DMS][68] | `source:dms` | CloudWatch, S3 | Yes | [Log collection][69] | -| [DocumentDB][70] | `source:docdb` | CloudWatch, S3 | Yes | [Log collection][71] | -| [ECS][16] | `source:ecs` | CloudWatch | Yes | [Log collection][17] | -| [EKS][62] | `source:eks` 1 | CloudWatch | Yes | [Log collection][63] | -| [Elastic Load Balancing (ELB)][18] | `source:elb` | CloudWatch, S3 | Yes | [Log collection][19] | -| [FSx][80] | `source:aws.fsx` | CloudWatch, S3 | No | [Log collection][81] | -| [Glue][76] | `source:glue` | CloudWatch, S3 | Yes | [Log collection][77] | -| [IoT][74] | `source:iot` | CloudWatch | Partial 2 | [Log collection][75] | -| [Lambda][21] | `source:lambda` | CloudWatch | Yes | [Log collection][22] | -| Lambda@Edge | `source:lambda` | CloudWatch | Yes | `-` | -| [MWAA][55] | `source:mwaa` | CloudWatch | Yes | [Log collection][56] | -| [Network Firewall][57] | `source:network-firewall` | CloudWatch, S3 | Yes | [Log collection][58] | -| [OpenSearch][82] | `source:opensearch` | CloudWatch | No | [Log collection][83] | -| [PCS][79] | `source:pcs` | CloudWatch | Partial 3 | `-` | -| [RDS][23] | `source:rds` 4 | CloudWatch | Yes | [Log collection][24] | -| [Redshift][34] | `source:redshift` | CloudWatch, S3 | Yes | [Log collection][36] | -| Redshift Serverless | `source:redshift-serverless` | CloudWatch | Yes | `-` | -| [Route 53][59] | `source:route53` 5 | CloudWatch | Yes | [Log collection][61] | -| [S3][29] | `source:s3` | S3 | Yes | [Log collection][30] | -| SSM | `source:ssm` | CloudWatch | Yes | `-` | -| [Step Functions][52] | `source:stepfunction` | CloudWatch | Yes | [Log collection][53] | -| [Transit Gateway][84] | `source:transitgateway` | CloudWatch, S3 | No | [Log collection][85] | -| [Verified Access][37] | `source:verified-access` | CloudWatch, S3 | Yes | [Log collection][39] | -| [VPC][40] | `source:vpc` | CloudWatch, S3 | Yes | [Log collection][42] | -| [VPN][26] | `source:vpn` | CloudWatch, S3 | Yes 6 | [Log collection][27] | -| [Web Application Firewall][49] | `source:waf` | S3 | Yes | [Log collection][50] | + +Each service name links to its setup instructions for enabling logging and sending logs to Datadog. Services without a link require no service-side setup. + +| AWS service | Log source | Storage | Automatic collection | +| ---------------------------------- | ----------------------------- | -------------- | -------------------- | +| [API Gateway][3] | `source:apigateway` | CloudWatch, S3 | Yes | +| [AppSync][4] | `source:appsync` | CloudWatch | Yes | +| Batch | `source:batch` | CloudWatch | Yes | +| [Bedrock][5] | `source:bedrock` | CloudWatch, S3 | No | +| Bedrock Agentcore | `source:bedrock-agentcore` | CloudWatch, S3 | Yes | +| [CloudFront][6] | `source:cloudfront` | CloudWatch, S3 | Yes | +| [CloudTrail][7] | `source:cloudtrail` | CloudWatch, S3 | Yes | +| [CodeBuild][8] | `source:codebuild` | CloudWatch, S3 | Yes | +| [DMS][9] | `source:dms` | CloudWatch, S3 | Yes | +| [DocumentDB][10] | `source:docdb` | CloudWatch, S3 | Yes | +| [ECS][11] | `source:ecs` | CloudWatch | Yes | +| [EKS][12] | `source:eks` 1 | CloudWatch | Yes | +| [Elastic Load Balancing (ELB)][13] | `source:elb` | CloudWatch, S3 | Yes | +| [FSx][14] | `source:aws.fsx` | CloudWatch, S3 | No | +| [Glue][15] | `source:glue` | CloudWatch, S3 | Yes | +| [IoT][16] | `source:iot` | CloudWatch | Partial 2 | +| [Lambda][17] | `source:lambda` | CloudWatch | Yes | +| Lambda@Edge | `source:lambda` | CloudWatch | Yes | +| [MWAA][18] | `source:mwaa` | CloudWatch | Yes | +| [Network Firewall][19] | `source:network-firewall` | CloudWatch, S3 | Yes | +| [OpenSearch][20] | `source:opensearch` | CloudWatch | No | +| [PCS][21] | `source:pcs` | CloudWatch | Partial 3 | +| [RDS][22] | `source:rds` 4 | CloudWatch | Yes | +| [Redshift][23] | `source:redshift` | CloudWatch, S3 | Yes | +| Redshift Serverless | `source:redshift-serverless` | CloudWatch | Yes | +| [Route 53][24] | `source:route53` 5 | CloudWatch | Yes | +| [S3][25] | `source:s3` | S3 | Yes | +| SSM | `source:ssm` | CloudWatch | Yes | +| [Step Functions][26] | `source:stepfunction` | CloudWatch | Yes | +| [Transit Gateway][27] | `source:transitgateway` | CloudWatch, S3 | No | +| [Verified Access][28] | `source:verified-access` | CloudWatch, S3 | Yes | +| [VPC][29] | `source:vpc` | CloudWatch, S3 | Yes | +| [VPN][30] | `source:vpn` | CloudWatch, S3 | Yes 6 | +| [Web Application Firewall][31] | `source:waf` | S3 | Yes | 1 EKS control plane logs also use the `kubernetes.audit`, `kube-scheduler`, `kube-apiserver`, `kube-controller-manager`, and `aws-iam-authenticator` sources.
2 Automatic collection for IoT is available at the account level only.
@@ -89,7 +88,7 @@ A `-` indicates that no additional setup step applies. 5 Covers both DNS query logs and Resolver query logs.
6 Automatic collection is available for CloudWatch log groups. For S3 buckets, [set up the trigger manually](#collecting-logs-from-s3-buckets). -**Note**: [Subscription filters][48] are automatically created on CloudWatch log groups by the DatadogForwarder, and are named in the format `DD_LOG_SUBSCRIPTION_FILTER_`. +**Note**: [Subscription filters][42] are automatically created on CloudWatch log groups by the DatadogForwarder, and are named in the format `DD_LOG_SUBSCRIPTION_FILTER_`. ### Services collected through another method @@ -97,9 +96,9 @@ The following AWS services are supported for log collection, but do not use the | AWS service | How logs are collected | | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -| [DynamoDB][13] | DynamoDB does not generate its own logs. API activity is captured through CloudTrail. See [Send logs to Datadog][14]. | -| [EC2][15] | Use the [Datadog Agent][15] to send your logs to Datadog. | -| [SNS][32] | SNS does not provide logs, but you can process logs and events that are transiting through to the SNS service. See [Send logs to Datadog][33]. | +| [DynamoDB][32] | DynamoDB does not generate its own logs. API activity is captured through CloudTrail. See [Send logs to Datadog][33]. | +| [EC2][34] | Use the [Datadog Agent][34] to send your logs to Datadog. | +| [SNS][35] | SNS does not provide logs, but you can process logs and events that are transiting through to the SNS service. See [Send logs to Datadog][36]. | ## Set up triggers @@ -115,7 +114,7 @@ Datadog can automatically configure triggers on the Datadog Forwarder Lambda fun To see which services support automatic collection, and the storage locations they support, see [Supported AWS services](#supported-aws-services). 1. If you haven't already, set up the [Datadog log collection AWS Lambda function][1]. -2. Ensure the policy of the IAM role used for [Datadog-AWS integration][43] has the following permissions. Information on how these permissions are used can be found in the descriptions below: +2. Ensure the policy of the IAM role used for [Datadog-AWS integration][37] has the following permissions. Information on how these permissions are used can be found in the descriptions below: ```text "airflow:GetEnvironment", @@ -232,13 +231,13 @@ To see which services support automatic collection, and the storage locations th | `wafv2:ListLoggingConfigurations` | List all logging configurations of the Web Application Firewall. | -3. In the [AWS Integration page][44], select the AWS Account to collect logs from and click on the {{< ui >}}Log Collection{{< /ui >}} tab. +3. In the [AWS Integration page][38], select the AWS Account to collect logs from and click on the {{< ui >}}Log Collection{{< /ui >}} tab. 4. In the {{< ui >}}Datadog Forwarder Lambda{{< /ui >}} section, enter the ARN of the Lambda created in the previous section and click {{< ui >}}Add{{< /ui >}}. The Lambda function appears in the table below with its name, version, and region. 5. In the {{< ui >}}Log Autosubscription{{< /ui >}} section, under {{< ui >}}Log Sources{{< /ui >}}, enable the services from which you'd like to collect logs by toggling them on. To stop collecting logs from a particular service, toggle the log source off. 6. (Optional) In the {{< ui >}}Log Source Tag Filters{{< /ui >}} section, you can filter log collection by resource tags for each log source. Select a log source from the dropdown menu and add tags in `key:value` format to limit which resources' logs are collected. **Note**: Resource tags are automatically lowercased to match Datadog platform conventions. Define your tag filters in lowercase to avoid mismatches. 7. If you have logs across multiple regions, you must create additional Lambda functions in those regions and add them in the **Datadog Forwarder Lambda** section. 8. To stop collecting all AWS logs from a specific Lambda function, hover over the Lambda in the table and click the delete icon. All triggers for that function are removed. -9. Within a few minutes of this initial setup, your AWS Logs appear in the Datadog [Log Explorer][45]. +9. Within a few minutes of this initial setup, your AWS Logs appear in the Datadog [Log Explorer][39]. ### Manually set up triggers @@ -372,8 +371,8 @@ Resources: ## Scrubbing and filtering -You can scrub emails or IP address from logs sent by the Lambda function, or define a custom scrubbing rule [in the Lambda parameters][46]. -You can also exclude or send only those logs that match a specific pattern by using the [filtering option][47]. +You can scrub emails or IP address from logs sent by the Lambda function, or define a custom scrubbing rule [in the Lambda parameters][40]. +You can also exclude or send only those logs that match a specific pattern by using the [filtering option][41]. ## Further reading @@ -381,70 +380,43 @@ You can also exclude or send only those logs that match a specific pattern by us [1]: /serverless/forwarder/ [2]: /serverless/forwarder#aws-privatelink-support -[3]: /integrations/amazon_api_gateway/ -[4]: /integrations/amazon_api_gateway/#log-collection -[6]: /integrations/amazon_cloudfront/ -[7]: /integrations/amazon_cloudfront/#enable-cloudfront-logging -[9]: /integrations/amazon_cloudtrail/#enable-cloudtrail-logging -[10]: /integrations/amazon_cloudtrail/#send-logs-to-datadog -[13]: /integrations/amazon_dynamodb/ -[14]: /integrations/amazon_dynamodb/#send-logs-to-datadog -[15]: /integrations/amazon_ec2/ -[16]: /integrations/amazon_ecs/ -[17]: /containers/amazon_ecs/logs/ -[18]: /integrations/amazon_elb/ -[19]: /integrations/amazon_elb/#enable-aws-elb-logging -[21]: /integrations/amazon_lambda/ -[22]: /integrations/amazon_lambda/#log-collection -[23]: /integrations/amazon_rds/ -[24]: /integrations/amazon_rds/#enable-rds-logging -[26]: /integrations/amazon-vpn/ -[27]: /integrations/amazon-vpn/#send-logs-to-datadog -[29]: /integrations/amazon_s3/ -[30]: /integrations/amazon_s3/#enable-s3-access-logs -[32]: /integrations/amazon_sns/ -[33]: /integrations/amazon_sns/#send-logs-to-datadog -[34]: /integrations/amazon_redshift/ -[36]: /integrations/amazon-redshift/#log-collection -[37]: /integrations/amazon-verified-access/ -[39]: /integrations/amazon-verified-access/#log-collection -[40]: /integrations/amazon_vpc/ -[42]: /integrations/amazon_vpc/#log-collection -[43]: /integrations/amazon_web_services/ -[44]: https://app.datadoghq.com/integrations/amazon-web-services -[45]: https://app.datadoghq.com/logs -[46]: https://github.com/DataDog/datadog-serverless-functions/tree/master/aws/logs_monitoring#log-scrubbing-optional -[47]: https://github.com/DataDog/datadog-serverless-functions/tree/master/aws/logs_monitoring#log-filtering-optional -[48]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters -[49]: /integrations/amazon_waf/ -[50]: /integrations/amazon_waf/#log-collection -[52]: /integrations/amazon_step_functions/ -[53]: /integrations/amazon_step_functions/#log-collection -[55]: /integrations/amazon_mwaa/ -[56]: /integrations/amazon_mwaa/#log-collection -[57]: /integrations/amazon_network_firewall/ -[58]: /integrations/amazon_network_firewall/#log-collection -[59]: /integrations/amazon_route53/ -[61]: /integrations/amazon_route53/#send-logs-to-datadog -[62]: /integrations/amazon-eks/ -[63]: /integrations/amazon-eks/#log-collection -[64]: /integrations/amazon-appsync/ -[65]: /integrations/amazon-appsync/#send-logs-to-datadog -[66]: /integrations/amazon-codebuild/ -[67]: /integrations/amazon-codebuild/#send-logs-to-datadog -[68]: /integrations/amazon-dms/ -[69]: /integrations/amazon-dms/#send-logs-to-datadog -[70]: /integrations/amazon-documentdb/ -[71]: /integrations/amazon-documentdb/#send-logs-to-datadog -[74]: /integrations/amazon-iot/ -[75]: /integrations/amazon-iot/#enable-logging -[76]: /integrations/amazon_glue/ -[77]: /integrations/amazon_glue/#log-collection -[78]: /integrations/amazon-bedrock/ -[79]: /integrations/amazon-pcs/ -[80]: /integrations/amazon_fsx/ -[81]: /integrations/amazon_fsx/#log-collection -[82]: /integrations/amazon_es/ -[83]: /integrations/amazon_es/#log-collection -[84]: /integrations/amazon_transit_gateway/ -[85]: /integrations/amazon_transit_gateway/#log-collection +[3]: /integrations/amazon_api_gateway/#log-collection +[4]: /integrations/amazon-appsync/#send-logs-to-datadog +[5]: /integrations/amazon-bedrock/ +[6]: /integrations/amazon_cloudfront/#log-collection +[7]: /integrations/amazon_cloudtrail/#send-logs-to-datadog +[8]: /integrations/amazon-codebuild/#send-logs-to-datadog +[9]: /integrations/amazon-dms/#send-logs-to-datadog +[10]: /integrations/amazon-documentdb/#send-logs-to-datadog +[11]: /containers/amazon_ecs/logs/ +[12]: /integrations/amazon-eks/#log-collection +[13]: /integrations/amazon_elb/#log-collection +[14]: /integrations/amazon_fsx/#log-collection +[15]: /integrations/amazon_glue/#log-collection +[16]: /integrations/amazon-iot/#enable-logging +[17]: /integrations/amazon_lambda/#log-collection +[18]: /integrations/amazon_mwaa/#log-collection +[19]: /integrations/amazon_network_firewall/#log-collection +[20]: /integrations/amazon_es/#log-collection +[21]: /integrations/amazon-pcs/ +[22]: /integrations/amazon_rds/#log-collection +[23]: /integrations/amazon-redshift/#log-collection +[24]: /integrations/amazon_route53/#send-logs-to-datadog +[25]: /integrations/amazon_s3/#enable-s3-access-logs +[26]: /integrations/amazon_step_functions/#log-collection +[27]: /integrations/amazon_transit_gateway/#log-collection +[28]: /integrations/amazon-verified-access/#log-collection +[29]: /integrations/amazon_vpc/#log-collection +[30]: /integrations/amazon-vpn/#send-logs-to-datadog +[31]: /integrations/amazon_waf/#log-collection +[32]: /integrations/amazon_dynamodb/ +[33]: /integrations/amazon_dynamodb/#send-logs-to-datadog +[34]: /integrations/amazon_ec2/ +[35]: /integrations/amazon_sns/ +[36]: /integrations/amazon_sns/#send-logs-to-datadog +[37]: /integrations/amazon_web_services/ +[38]: https://app.datadoghq.com/integrations/amazon-web-services +[39]: https://app.datadoghq.com/logs +[40]: https://github.com/DataDog/datadog-serverless-functions/tree/master/aws/logs_monitoring#log-scrubbing-optional +[41]: https://github.com/DataDog/datadog-serverless-functions/tree/master/aws/logs_monitoring#log-filtering-optional +[42]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters From 86a5265cc552aef669b479ada04833058dbc6d5f Mon Sep 17 00:00:00 2001 From: Max Phillips Date: Fri, 31 Jul 2026 13:54:29 -0500 Subject: [PATCH 3/7] Clarify step 2 link to the supported services table --- .../send-aws-services-logs-with-the-datadog-lambda-function.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md b/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md index 4243a88550b..09fee9c3962 100644 --- a/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md +++ b/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md @@ -27,7 +27,7 @@ AWS service logs can be collected with the Datadog Forwarder Lambda function. Th To start collecting logs from your AWS services: 1. Set up the [Datadog Forwarder Lambda function][1] in your AWS account. -2. [Enable logging](#supported-aws-services) for your AWS service (most AWS services can log to a S3 bucket or CloudWatch Log Group). +2. Enable logging for your AWS service. Find your service in [Supported AWS services](#supported-aws-services) for its setup instructions (most AWS services can log to a S3 bucket or CloudWatch Log Group). 3. [Set up the triggers](#set-up-triggers) that cause the Forwarder Lambda to execute when there are new logs to be forwarded. There are two ways to configure the triggers. **Notes**: From efd8825c32ec851a5fc7705179db4b978c70c511 Mon Sep 17 00:00:00 2001 From: Max Phillips Date: Fri, 31 Jul 2026 14:20:04 -0500 Subject: [PATCH 4/7] reword enable integration steps --- ...d-aws-services-logs-with-the-datadog-lambda-function.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md b/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md index 09fee9c3962..0b60ca9caa9 100644 --- a/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md +++ b/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md @@ -27,7 +27,7 @@ AWS service logs can be collected with the Datadog Forwarder Lambda function. Th To start collecting logs from your AWS services: 1. Set up the [Datadog Forwarder Lambda function][1] in your AWS account. -2. Enable logging for your AWS service. Find your service in [Supported AWS services](#supported-aws-services) for its setup instructions (most AWS services can log to a S3 bucket or CloudWatch Log Group). +2. Enable logging for your AWS service. Find your service in [Supported AWS services](#supported-aws-services) to see its setup instructions. Most AWS services can log to a S3 bucket or a CloudWatch Log Group. 3. [Set up the triggers](#set-up-triggers) that cause the Forwarder Lambda to execute when there are new logs to be forwarded. There are two ways to configure the triggers. **Notes**: @@ -36,14 +36,13 @@ To start collecting logs from your AWS services: ## Supported AWS services -Any AWS service that generates logs into a S3 bucket or a CloudWatch Log Group is supported. The following table lists the services collected with the Datadog Forwarder Lambda function: +The Datadog Forwarder Lambda function supports any AWS service that generates logs into a S3 bucket or a CloudWatch Log Group. The following table lists the services collected: +- **AWS service**: The supported AWS service. Each service name links to its setup instructions to enable logging and sending logs to Datadog. Services without a link require no service-side setup. - **Log source**: The `source` tag Datadog applies to the logs. Use it to find your logs in the [Log Explorer][40]. - **Storage**: Where the AWS service can write logs that the Forwarder collects. - **Automatic collection**: Whether Datadog can [automatically set up the triggers](#automatically-set-up-triggers) for that log source. If not, [set up the triggers manually](#manually-set-up-triggers). -Each service name links to its setup instructions for enabling logging and sending logs to Datadog. Services without a link require no service-side setup. - | AWS service | Log source | Storage | Automatic collection | | ---------------------------------- | ----------------------------- | -------------- | -------------------- | | [API Gateway][3] | `source:apigateway` | CloudWatch, S3 | Yes | From 255254973d8453ce852408516642f14bd33355a5 Mon Sep 17 00:00:00 2001 From: Max Phillips Date: Fri, 31 Jul 2026 14:28:15 -0500 Subject: [PATCH 5/7] adjust wording of first bullet point --- .../send-aws-services-logs-with-the-datadog-lambda-function.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md b/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md index 0b60ca9caa9..858d2d8fdd7 100644 --- a/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md +++ b/content/en/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function.md @@ -38,7 +38,7 @@ To start collecting logs from your AWS services: The Datadog Forwarder Lambda function supports any AWS service that generates logs into a S3 bucket or a CloudWatch Log Group. The following table lists the services collected: -- **AWS service**: The supported AWS service. Each service name links to its setup instructions to enable logging and sending logs to Datadog. Services without a link require no service-side setup. +- **AWS service**: The AWS service that generates the logs. Each service name links to its log collection setup instructions. Services without a link require no service-side setup. - **Log source**: The `source` tag Datadog applies to the logs. Use it to find your logs in the [Log Explorer][40]. - **Storage**: Where the AWS service can write logs that the Forwarder collects. - **Automatic collection**: Whether Datadog can [automatically set up the triggers](#automatically-set-up-triggers) for that log source. If not, [set up the triggers manually](#manually-set-up-triggers). From d72998a6c694c79f24b792cb1f366faa9ef0ab8a Mon Sep 17 00:00:00 2001 From: Max Phillips Date: Fri, 31 Jul 2026 15:51:06 -0500 Subject: [PATCH 6/7] add bunyan and pino instructions --- content/en/logs/log_collection/nodejs.md | 110 +++++++++++++++++++---- 1 file changed, 93 insertions(+), 17 deletions(-) diff --git a/content/en/logs/log_collection/nodejs.md b/content/en/logs/log_collection/nodejs.md index ea24e43b3f2..7213bbf9c33 100644 --- a/content/en/logs/log_collection/nodejs.md +++ b/content/en/logs/log_collection/nodejs.md @@ -26,15 +26,22 @@ further_reading: ## Configure your logger -To send your logs to Datadog, log to a file and [tail][14] that file with your Datadog Agent. Use the [Winston][1] logging library to log from your Node.js application. +To send your logs to Datadog, log to a file and [tail][14] that file with your Datadog Agent. Use a Node.js logging library, such as [Winston][1], [Bunyan][15], or [Pino][16], to log from your Node.js application. -Winston is available through [NPM][2], to get started, you want to add the dependency to your code: +### Log to a file + +In your bootstrap file or in your code, declare the logger in the following way: + +{{< tabs >}} +{{% tab "Winston 3.0" %}} + +Winston is available through [NPM][2]. Add the dependency to your code: ```text npm install --save winston ``` -`package.json` is updated with the corresponding dependencies: +`package.json` is updated with the corresponding dependency: ```js { @@ -49,13 +56,6 @@ npm install --save winston } ``` -### Log to a file - -In your bootstrap file or in your code, declare the logger in the following way: - -{{< tabs >}} -{{% tab "Winston 3.0" %}} - ```js const { createLogger, format, transports } = require('winston'); @@ -76,9 +76,22 @@ logger.log('info', 'Hello simple log!'); logger.info('Hello log with metas',{color: 'blue' }); ``` +Check the content of the `.log` file to confirm that Winston is logging in JSON: + +```json +{"level":"info","message":"Hello simple log!","timestamp":"2015-04-23T16:52:05.337Z"} +{"color":"blue","level":"info","message":"Hello log with metas","timestamp":"2015-04-23T16:52:05.339Z"} +``` + {{% /tab %}} {{% tab "Winston 2.0" %}} +Winston is available through [NPM][2]. Add the dependency to your code: + +```text +npm install --save winston +``` + ```js var winston = require('winston'); @@ -98,9 +111,6 @@ logger.log('info', 'Hello simple log!'); logger.info('Hello log with metas',{color: 'blue' }); ``` -{{% /tab %}} -{{< /tabs >}} - Check the content of the `.log` file to confirm that Winston is logging in JSON: ```json @@ -108,9 +118,72 @@ Check the content of the `.log` file to confirm that Winston is loggi {"color":"blue","level":"info","message":"Hello log with metas","timestamp":"2015-04-23T16:52:05.339Z"} ``` +{{% /tab %}} +{{% tab "Bunyan" %}} + +Bunyan is available through [NPM][2]. Add the dependency to your code: + +```text +npm install --save bunyan +``` + +```js +const bunyan = require('bunyan'); + +const logger = bunyan.createLogger({ + name: '', + streams: [ + { + level: 'info', + path: `${appRoot}/logs/.log`, + }, + ], +}); + +// Example logs +logger.info('Hello simple log!'); +logger.info({ color: 'blue' }, 'Hello log with metas'); +``` + +Bunyan logs in JSON by default. Check the content of the `.log` file to confirm: + +```json +{"name":"","hostname":"my-host","pid":1234,"level":30,"msg":"Hello simple log!","time":"2015-04-23T16:52:05.337Z","v":0} +{"name":"","hostname":"my-host","pid":1234,"level":30,"color":"blue","msg":"Hello log with metas","time":"2015-04-23T16:52:05.339Z","v":0} +``` + +{{% /tab %}} +{{% tab "Pino" %}} + +Pino is available through [NPM][2]. Add the dependency to your code: + +```text +npm install --save pino +``` + +```js +const pino = require('pino'); + +const logger = pino(pino.destination(`${appRoot}/logs/.log`)); + +// Example logs +logger.info('Hello simple log!'); +logger.info({ color: 'blue' }, 'Hello log with metas'); +``` + +Pino logs in JSON by default. Check the content of the `.log` file to confirm: + +```json +{"level":30,"time":1429807925337,"pid":1234,"hostname":"my-host","msg":"Hello simple log!"} +{"level":30,"time":1429807925339,"pid":1234,"hostname":"my-host","color":"blue","msg":"Hello log with metas"} +``` + +{{% /tab %}} +{{< /tabs >}} + ## Configure your Datadog Agent -Once [log collection is enabled][6], set up [custom log collection][7] to tail your log files and send new logs to Datadog. +After [log collection is enabled][6], set up [custom log collection][7] to tail your log files and send new logs to Datadog. 1. Create a `nodejs.d/` folder in the `conf.d/` [Agent configuration directory][8]. 2. Create a `conf.yaml` file in `nodejs.d/` with the following content: @@ -137,16 +210,16 @@ If logs are in JSON format, Datadog automatically [parses the log messages][11] ## Connect your service across logs and traces -If APM is enabled for this application, connect your logs and traces by automatically adding trace IDs, span IDs, -`env`, `service`, and `version` to your logs by [following the APM Node.js instructions][3]. +If APM is enabled for this application, connect your logs and traces by [following the APM Node.js instructions][3]. This automatically adds trace IDs, span IDs, `env`, `service`, and `version` to your logs. **Note**: If the Datadog SDK injects `service` into your logs, it overrides the value set in the Agent configuration. ## Agentless logging -You can stream your logs from your application to Datadog without installing an Agent on your host. However, it is recommended that you use an Agent to forward your logs as it provides a native connection management. +You can stream your logs from your application to Datadog without installing an Agent on your host. However, Datadog recommends you use an Agent to forward your logs as it provides a native connection management. Use the [Winston HTTP transport][4] to send your logs directly through the [Datadog Log API][5]. + In your bootstrap file or in your code, declare the logger in the following way: ```javascript @@ -176,6 +249,7 @@ logger.info('Hello log with metas',{color: 'blue' }); **Note:** You can also use the community-supported [Datadog Transport][13]. +Bunyan and Pino don't include a built-in HTTP transport. To stream logs from these libraries directly to Datadog without an Agent, use a community-supported package or logging layer that adds Datadog HTTP support. ## Troubleshooting @@ -208,3 +282,5 @@ Make sure that the parameter `max_connect_retries` is not set to `1` (the defaul [12]: /logs/explorer/#overview [13]: https://github.com/winstonjs/winston/blob/master/docs/transports.md#datadog-transport [14]: /glossary/#tail +[15]: https://github.com/trentm/node-bunyan +[16]: https://github.com/pinojs/pino From af5f7b919e442d82b6bf2a58ec1742928476fafd Mon Sep 17 00:00:00 2001 From: Max Phillips Date: Fri, 31 Jul 2026 15:54:44 -0500 Subject: [PATCH 7/7] Revert "add bunyan and pino instructions" This reverts commit d72998a6c694c79f24b792cb1f366faa9ef0ab8a. --- content/en/logs/log_collection/nodejs.md | 110 ++++------------------- 1 file changed, 17 insertions(+), 93 deletions(-) diff --git a/content/en/logs/log_collection/nodejs.md b/content/en/logs/log_collection/nodejs.md index 7213bbf9c33..ea24e43b3f2 100644 --- a/content/en/logs/log_collection/nodejs.md +++ b/content/en/logs/log_collection/nodejs.md @@ -26,22 +26,15 @@ further_reading: ## Configure your logger -To send your logs to Datadog, log to a file and [tail][14] that file with your Datadog Agent. Use a Node.js logging library, such as [Winston][1], [Bunyan][15], or [Pino][16], to log from your Node.js application. +To send your logs to Datadog, log to a file and [tail][14] that file with your Datadog Agent. Use the [Winston][1] logging library to log from your Node.js application. -### Log to a file - -In your bootstrap file or in your code, declare the logger in the following way: - -{{< tabs >}} -{{% tab "Winston 3.0" %}} - -Winston is available through [NPM][2]. Add the dependency to your code: +Winston is available through [NPM][2], to get started, you want to add the dependency to your code: ```text npm install --save winston ``` -`package.json` is updated with the corresponding dependency: +`package.json` is updated with the corresponding dependencies: ```js { @@ -56,6 +49,13 @@ npm install --save winston } ``` +### Log to a file + +In your bootstrap file or in your code, declare the logger in the following way: + +{{< tabs >}} +{{% tab "Winston 3.0" %}} + ```js const { createLogger, format, transports } = require('winston'); @@ -76,22 +76,9 @@ logger.log('info', 'Hello simple log!'); logger.info('Hello log with metas',{color: 'blue' }); ``` -Check the content of the `.log` file to confirm that Winston is logging in JSON: - -```json -{"level":"info","message":"Hello simple log!","timestamp":"2015-04-23T16:52:05.337Z"} -{"color":"blue","level":"info","message":"Hello log with metas","timestamp":"2015-04-23T16:52:05.339Z"} -``` - {{% /tab %}} {{% tab "Winston 2.0" %}} -Winston is available through [NPM][2]. Add the dependency to your code: - -```text -npm install --save winston -``` - ```js var winston = require('winston'); @@ -111,6 +98,9 @@ logger.log('info', 'Hello simple log!'); logger.info('Hello log with metas',{color: 'blue' }); ``` +{{% /tab %}} +{{< /tabs >}} + Check the content of the `.log` file to confirm that Winston is logging in JSON: ```json @@ -118,72 +108,9 @@ Check the content of the `.log` file to confirm that Winston is loggi {"color":"blue","level":"info","message":"Hello log with metas","timestamp":"2015-04-23T16:52:05.339Z"} ``` -{{% /tab %}} -{{% tab "Bunyan" %}} - -Bunyan is available through [NPM][2]. Add the dependency to your code: - -```text -npm install --save bunyan -``` - -```js -const bunyan = require('bunyan'); - -const logger = bunyan.createLogger({ - name: '', - streams: [ - { - level: 'info', - path: `${appRoot}/logs/.log`, - }, - ], -}); - -// Example logs -logger.info('Hello simple log!'); -logger.info({ color: 'blue' }, 'Hello log with metas'); -``` - -Bunyan logs in JSON by default. Check the content of the `.log` file to confirm: - -```json -{"name":"","hostname":"my-host","pid":1234,"level":30,"msg":"Hello simple log!","time":"2015-04-23T16:52:05.337Z","v":0} -{"name":"","hostname":"my-host","pid":1234,"level":30,"color":"blue","msg":"Hello log with metas","time":"2015-04-23T16:52:05.339Z","v":0} -``` - -{{% /tab %}} -{{% tab "Pino" %}} - -Pino is available through [NPM][2]. Add the dependency to your code: - -```text -npm install --save pino -``` - -```js -const pino = require('pino'); - -const logger = pino(pino.destination(`${appRoot}/logs/.log`)); - -// Example logs -logger.info('Hello simple log!'); -logger.info({ color: 'blue' }, 'Hello log with metas'); -``` - -Pino logs in JSON by default. Check the content of the `.log` file to confirm: - -```json -{"level":30,"time":1429807925337,"pid":1234,"hostname":"my-host","msg":"Hello simple log!"} -{"level":30,"time":1429807925339,"pid":1234,"hostname":"my-host","color":"blue","msg":"Hello log with metas"} -``` - -{{% /tab %}} -{{< /tabs >}} - ## Configure your Datadog Agent -After [log collection is enabled][6], set up [custom log collection][7] to tail your log files and send new logs to Datadog. +Once [log collection is enabled][6], set up [custom log collection][7] to tail your log files and send new logs to Datadog. 1. Create a `nodejs.d/` folder in the `conf.d/` [Agent configuration directory][8]. 2. Create a `conf.yaml` file in `nodejs.d/` with the following content: @@ -210,16 +137,16 @@ If logs are in JSON format, Datadog automatically [parses the log messages][11] ## Connect your service across logs and traces -If APM is enabled for this application, connect your logs and traces by [following the APM Node.js instructions][3]. This automatically adds trace IDs, span IDs, `env`, `service`, and `version` to your logs. +If APM is enabled for this application, connect your logs and traces by automatically adding trace IDs, span IDs, +`env`, `service`, and `version` to your logs by [following the APM Node.js instructions][3]. **Note**: If the Datadog SDK injects `service` into your logs, it overrides the value set in the Agent configuration. ## Agentless logging -You can stream your logs from your application to Datadog without installing an Agent on your host. However, Datadog recommends you use an Agent to forward your logs as it provides a native connection management. +You can stream your logs from your application to Datadog without installing an Agent on your host. However, it is recommended that you use an Agent to forward your logs as it provides a native connection management. Use the [Winston HTTP transport][4] to send your logs directly through the [Datadog Log API][5]. - In your bootstrap file or in your code, declare the logger in the following way: ```javascript @@ -249,7 +176,6 @@ logger.info('Hello log with metas',{color: 'blue' }); **Note:** You can also use the community-supported [Datadog Transport][13]. -Bunyan and Pino don't include a built-in HTTP transport. To stream logs from these libraries directly to Datadog without an Agent, use a community-supported package or logging layer that adds Datadog HTTP support. ## Troubleshooting @@ -282,5 +208,3 @@ Make sure that the parameter `max_connect_retries` is not set to `1` (the defaul [12]: /logs/explorer/#overview [13]: https://github.com/winstonjs/winston/blob/master/docs/transports.md#datadog-transport [14]: /glossary/#tail -[15]: https://github.com/trentm/node-bunyan -[16]: https://github.com/pinojs/pino