-
Notifications
You must be signed in to change notification settings - Fork 478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amazon.Lambda.Logging.AspNetCore should support structural json logging #1144
Comments
@Dreamescaper Thanks for submitting feature request. Please advise on how you came up with the JSON format of the log output. Did you use Serilog structured logging as reference? |
@ashishdhingra https://docs.microsoft.com/ru-ru/dotnet/core/extensions/console-log-formatter#json |
@Dreamescaper that way you can use whatever MS supports including structured logging and not have any dependency on AWS .NET assemblies |
@petarrepac |
Needs review with the team. |
@Dreamescaper Good afternoon. Structured logging support was added as part of PR #1803. Please refer to #1747 for details. Kindly confirm if it covers your scenario. Thanks, |
Not sure. Per my understanding, in order to use it with AspNetCore, it would have to implement Microsoft.Extensions.Logging.ILogger, right? |
Describe the feature
I should be able to use structural logging with lambda logger.
Use Case
I'd like to use structural logging either with CloudWatch Insights, or with third party system (e.g. DataDog).
Proposed Solution
Add Json lambda logger to DI via smth like this:
This logger should support logging "state" object:
logger.LogInformation("Saving entity {entityId} by user {userId}.", entityId, userId);
This logger should support logging "scopes" object:
Ideally, if I use json logger, it shouldn't be needed to set 'AWS_LAMBDA_HANDLER_LOG_FORMAT' environment variable.
Other Information
No response
Acknowledgements
AWS .NET SDK and/or Package version used
Amazon.Lambda.Logging.AspNetCore Version="3.1.0"
Targeted .NET Platform
.NET6
Operating System and version
AmazonLinux
The text was updated successfully, but these errors were encountered: