generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Title
[Bug]: Structured logger adds unneccessary \n to logging payloads
Expected Behavior
I expected no \n in my log output e.g.,
{"requestId":"544f81ff-41cf-4d81-a3b5-10f391f0b70c","timestamp":"2025-11-25T17:14:03.442Z","level":"INFO","executionArn":"92710866-c089-4373-82ba-2182942d4da1","message":"Order successfully processed: { orderId: 'ORD-123', status: 'processed', timestamp: '2025-2025-2025' }"}Actual Behavior
Instead, I'm receiving \n formatted output when the timestamp field exceeds a certain length:
{"requestId":"dda382c1-aefa-40e8-a4e3-7dd7b1824768","timestamp":"2025-11-25T17:14:37.218Z","level":"INFO","executionArn":"52152021-8326-41c1-b8bb-cc80e548797b","message":"Order successfully processed: {\n orderId: 'ORD-123',\n status: 'processed',\n timestamp: '2025-2025-2025'\n}"}For example, when timestamp is just 2025-2025 there's no \n. Not sure where the code sits which adds \n if the object/field exceeds a certain length?
Steps to Reproduce
Here's my code which prints the above during unit testing
const processed = await context.step("process-order", async (stepCtx) => {
return { orderId: event.orderId, status: "processed", timestamp: "2025-2025-2025" }
});
context.logger.info("Order successfully processed:", processed);SDK Version
development (0df43d6)
Node.js Version
22.x
Is this a regression?
No
Last Working Version
No response
Additional Context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working