'How Serilog posts to CloudWatch without any configuration setup?
I am migrating an app done in net core from Azure to AWS. Backend is an Asp.NetCore WebApi which uses Serilog for logging. I simply put it behind a subclass of Amazon.Lambda.AspNetCoreServer.APIGatewayProxyFunction and now it runs in a lambda function. What perplexes me is how the logs generated with Serilog go to Cloudwatch of this deployed lambda function automatically. Can someone explain how these logging libraries work that perhaps the logging entities in Lambda nuget package can automatically tap on to?
Solution 1:[1]
By default, everything that you write to the Console
from within an AWS Lambda function, ends up in AWS CloudWatch, so if you are writing to the Console via Serilog.Sinks.Console, that's why...
ps: You might also be interested in using Amazon's officially supported Serilog sink AWS.Logger.SeriLog
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Ruben Bartelink |