Skip to content

AWS Lambda not assigning lambda log date prefix correctly

0

Since the beginning of August 2025, I've noticed some inconsistent cases where the AWS logs are not being assigned the proper values for the date prefix of the log stream name. The creation time of the log stream is UTC and so is the prefix date, but lambda executions and log stream creations happening within seconds of one another are seeing some not get assigned the prefix properly to the creation date, but rather assigning it to the day before (so 8/25 creation assigned 8/24 in one case, and 8/18 assigned 8/17 in two cases; there were a few others earlier in August as well and since then so far). And in some cases, even assigning the day before date to a log created a few seconds after one that created just before it that did get assigned a the correct current day.

Here are a screen shots:

Enter image description here

Enter image description here

Is this a known bug/issue AWS is trying to resolve? (I only have a Basic tier plan so cannot submit a case).

UPDATE (Wondering if this is part of the issue):

First

This url https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-environment.html has a note currently that says:

AWS is currently implementing changes to the Lambda service. Due to these changes, you may see minor differences between the structure and content of system log messages and trace segments emitted by different Lambda functions in your AWS account.

If your function's system log configuration is set to plain text, this change affects the log messages captured in CloudWatch Logs when your function experiences an invoke failure. The following examples show log outputs in both old and new formats.

These changes will be implemented during the coming weeks, and all functions in all AWS Regions except the China and GovCloud regions will transition to use the new-format log messages and trace segments.

So I'm wondering if a bug was introduced during these log updates.

Second

This issue started after we updated to the Node 22 environment for the lambda (previously 18). While Node environment should not affect the UTC timing of the log stream name, that fact might be significant to AWS support staff in figuring out why this is occurring.

asked a year ago244 views

1 Answer
-1

Based on the information available, there isn't a documented known issue specifically about Lambda log stream date prefixes being inconsistently assigned.

By default, AWS Lambda automatically creates log streams in CloudWatch Logs with a naming convention that follows the format YYYY/MM/DD/[<FunctionVersion>]<InstanceId>. The date portion (YYYY/MM/DD) is meant to represent when the Lambda function instance was created.

For custom log groups, Lambda follows a similar convention: YYYY/MM/DD/<function_name>[<function_version>][<execution_environment_GUID>].

The inconsistency you're observing where log streams created within seconds of each other are getting different date prefixes could potentially happen if:

  1. The log streams are being created very close to midnight UTC, where some executions fall on one day and others on the next.
  2. There might be some caching or batching of log stream creation that's causing the timestamp discrepancy.

Since you're unable to submit a case with a Basic tier plan, you might want to:

  • Monitor if the issue persists or follows any pattern
  • Check if the actual timestamps within the log entries are correct, even if the stream name prefix is not
  • Consider posting your observation on AWS re:Post for broader community input

If this is affecting your ability to find or analyze logs, you might need to adjust your log querying approach to account for potential date prefix inconsistencies.
Sources
Logging and metrics for AWS Lambda - AWS Prescriptive Guidance
Lambda Function is Showing different CloudWatch Log Group | AWS re:Post

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.