Skip to content

Bug: Logger serializes bool values as true/false - Log queries with CloudWatch Insights must use 1/0 #667

@nCubed

Description

@nCubed

Expected Behaviour

  • When the Logger writes a log entry for a bool value, the log entry is true/false.
  • When querying the logs with CloudWatch Insights, the bool value should be queryable with true/false

Current Behaviour

  • CloudWatch Insights queries return the bool value as a 1/0
  • CloudWatch Insights filters must use 1/0 for the bool value

Code snippet

Logger.LogInformation(new
{
@true = true,
@false = false
});

Cloud Insights

message.true=1
message.false=0

Possible Solution

No response

Steps to Reproduce

  • Write a log entry with a boolean value.
  • Retrieve/query the log with CloudWatch Insights.

Powertools for AWS Lambda (.NET) version

latest

AWS Lambda function runtime

dotnet8

Debugging logs

No response

Metadata

Metadata

Assignees

Labels

area/loggingCore logging utilitynot-a-bugNew and existing bug reports incorrectly submitted as bug

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions