Skip to content

Including Exception and EventId in Lambda Logger messages#401

Merged
normj merged 3 commits intoaws:masterfrom
karpikpl:master
Feb 22, 2019
Merged

Including Exception and EventId in Lambda Logger messages#401
normj merged 3 commits intoaws:masterfrom
karpikpl:master

Conversation

@karpikpl
Copy link
Copy Markdown
Contributor

Issue #, if available:
Microsoft.Extensions.Logging interface supports logging EventId and Exceptions, but when LambdaLogger is configured, those objects are not saved in CloudWatch.

Sample scenario:

logger.LogError(LoggingEvents.DbOperationError, ex, $"SelectData: {spName} SqlException Number: {se.Number} Sql Parameter: {spc}");

The natural expectation is that both Logging Event and Exception will be available in CloudWatch, which is not the case.

Description of changes:
I've included 2 new settings on Lambda Logger Options to enable EventId and Exceptions logging.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@normj
Copy link
Copy Markdown
Member

normj commented Feb 21, 2019

Thanks for the PR. I'll take a look

@normj normj merged commit 8d25d2e into aws:master Feb 22, 2019
@normj
Copy link
Copy Markdown
Member

normj commented Feb 22, 2019

This was released as version 2.2.0 of Amazon.Lambda.Logging.AspNetCore. Thangs again for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants