From the course: ASP.NET Core: Health Checks and Logging
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: Add logging to the sample app - ASP.NET Core Tutorial
From the course: ASP.NET Core: Health Checks and Logging
Challenge: Add logging to the sample app
(upbeat music) - [Instructor] It's time for a quick coding challenge, don't you think? Well, actually two challenges, and I hope you like them and have some joy and success in actually tackling those challenges. First of all, in the products controller on more or less line 72, plus or minus one as always, there's this weird call of Math.Max and then the page query parameter one. Basically the idea here is that if the page parameter is set to zero, we should use one instead otherwise some catastrophic things will happen. I don't know whether that is the best solution, but if the page parameter is actually set to zero, then we might want to know. So at a lock entry here, and secondly, we are using a database as you know and I've opened a database here in SQL Server Management Studio. Now what happens if I stop the database? Yes, I want to, and the question is, what happens in the app? And can you lock that?
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Understanding ILogger<T>1m 48s
-
What's in the template?6m 3s
-
Adding log entries5m 38s
-
Understanding log levels4m 48s
-
Configuring logging7m 40s
-
Logging to files7m 17s
-
Logging to Azure8m 12s
-
Using log scopes4m
-
Challenge: Add logging to the sample app1m 17s
-
Solution: Add logging to the sample app4m 26s
-
Summary of ASP.NET logging1m
-
-