Skip to content

Issue with unhandled exception message been multilined #1265

@svoychik

Description

@svoychik

Describe the bug

As a result of unhandled exceptions, logs are written into Cloudwatch in multiline format.
#1165 - previous attempt to fix the issue didn't help so this probably has to be double-checked

For us, this issue causes quite a lot of garbage logs, which distracts attention from really important things

Expected Behavior

The exception message is stored as a single CloudWatch row. That's how it worked before on .NET 3.1

Current Behavior

Currently, exception logs are multilined, see screenshot
image

Reproduction Steps

You need to use lambda with .NET 6 AWS-supported runtime.
Then make that lambda fail - Throw any exception from lambda ExecuteAsync method and open CloudWatch logs to see the multilined exception logs

Possible Solution

No response

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

Amazon.Lambda.Core 2.1.0
Amazon.Lambda.Serialization.Json 2.0.0
Amazon.Lambda.APIGatewayEvents 2.4.1
Amazon.Lambda.Logging.AspNetCore 3.1.0
AWSSDK.CloudWatch 3.7.4.25
AWSSDK.DynamoDBv2 3.7.3.50
AWSSDK.StepFunctions 3.7.0.174

Targeted .NET Platform

.NET 6

Operating System and version

.NET 6 runtime

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions