{
  "id": 14638293,
  "title": "Moving Lambda Logs to a Centralized Location [S3]",
  "url": "https://urgent.news/2026/10/15/moving-lambda-logs-to-a-centralized-location-s3",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-15T07:19:33.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/sunnybhambhani/moving-lambda-logs-to-a-centralized-location-s3-17i5"
  },
  "original_language": "en",
  "account": "AWS Lambda provides built-in logging capabilities, but as applications expand, the question arises of where to send these logs. For testing purposes, CloudWatch Logs often suffice. However, for long-term storage, centralized analysis or integration with downstream systems, AWS offers alternative methods to forward Lambda logs. Within the Lambda console, navigate to Configuration - Monitoring and operational tools - Logging configuration - Edit - Log Destination to select one of three options: Amazon CloudWatch Logs (default), Amazon S3, or Amazon Data Firehose. Each option serves a distinct purpose, and the choice depends on the desired outcome for the logs following their generation by Lambda. The chosen method remains consistent with the initial function definition. When sending logs to Amazon S3 or Amazon Data Firehose, Lambda necessitates a log group with the delivery log class. This class, designed for efficient forwarding, lacks some CloudWatch Logs features such as Logs Insights and Live Tail. Moreover, the retention period for log events when using the delivery log class is fixed at two days and cannot be altered. In this scenario, Amazon S3 is utilized for log storage. A new log group named dummy_lambda_logs_to_s3 is created and assigned to the S3 bucket arn:aws:s3:::s3-lambda-logs. An IAM role is also established for the Lambda function, defined in two JSON files (02_iam_role_trust_relationships.json and 02_iam_role_permissions.json). After configuration, Lambda begins delivering logs to the designated S3 bucket. The structured path of these logs in S3 allows for organization by account, region, log group, and time. Keeping logs in CloudWatch Logs is beneficial for day-to-day debugging, but S3 offers a more cost-effective archival solution, while Firehose enables near real-time streaming to other systems. The optimal destination for Lambda logs depends on the intended use case. CloudWatch Logs is ideal for quick operational visibility, S3 for long-term retention, and Firehose for streaming logs to another platform. For this example, S3 provides a balanced approach, offering centralized storage while maintaining simplicity in setup.",
  "summary": "Moving Lambda Logs to a Centralized Location[S3] AWS Lambda gives you logs out of the box, but once an application starts growing, the real question becomes: where should those logs go? If you are only testing a function, CloudWatch Logs is usually enough. But if you want long-term storage, centralized analysis, or integration with downstream systems, AWS gives you a few different ways to send…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}