2

I am new to .Net Core 5.0, I am unable to find any suitable guide to check how to setup logging to Cloudwatch using Serilog.

Currently, in our application, we are logging to file & console using Serilog. Now the requirement is to log in Cloudwatch also. Existing configuration is in appsettings.Development.json file where we have a section called "Serilog" which contains the "writeTo" section. Can anyone guide me how to set up logging in Cloudwatch using appsettings.json file ??

  • maybe this one helps? https://stackoverflow.com/questions/53321096/how-to-configure-a-serilog-sink-for-logging-to-cloudwatch – Ikigai programmeh Nov 16 '21 at 20:17
  • It's not so much in detail. I would like to have a detailed answer like which packages to use, how & where to store the AWS credentials (don't know whether needed or not) & then how to configure everything. – Dibyo Chatterjee Nov 17 '21 at 04:55

1 Answers1

0

The AWS.Logger.SeriLog NuGet package provides a SeriLog sink that will send the log messages to CloudWatch Logs. The package is on GitHub with more information on how to use. https://github.com/aws/aws-logging-dotnet#serilog

Norm Johanson
  • 2,964
  • 14
  • 13
  • I am using appsettings.json file where I have that Serilog node with other properties. I am getting confused on one thing that is "Do I need to pass AWS credentials? If yes, then what credentials are needed & also how to configure that part?" – Dibyo Chatterjee Nov 18 '21 at 04:43