Logging in AWS

If you are using AWS, then adding logging to your ASP.NET Core 3 application will be very straightforward for you. You just have to write your application logs to the console, and the applications—which are deployed in AWS Elastic Beanstalk—will automatically store their logs in AWS CloudWatch. You will then be able to use the CloudWatch dashboard to analyze what is happening. This is comparable to Application Insights and its dashboard, which you have seen in the preceding example.

You will now learn how to access logs for applications you have deployed to AWS Elastic Beanstalk, as follows:

  1. Publish Tic-Tac-Toe Web Application to AWS Elastic Beanstalk. If you do not know how to do this, you can look it up in Chapter 12, Hosting ASP.NET Core 3 Applications.
  2. Start the application, go to AWS Management Console, enter Beanstalk in the AWS services Find Services textbox, and click on the displayed link. You will be redirected to the Elastic Beanstalk welcome page, as follows:

  1. On the Elastic Beanstalk welcome page, select the TicTacToe application you deployed in the preceding step, as shown here:
  1. Click on Logs in the left-hand menu, and then click on Request Logs | Last 100 Lines. You can now download the log files you need to analyze, as shown in the following screenshot:

  1. Download a log file and check its content, as follows:

You have seen how to handle logging in various environments, on-premises, and in the cloud. The next section will introduce you to monitoring, and how it can aid you in analyzing problems in real time.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.184.189