Presentation is loading. Please wait.

Presentation is loading. Please wait.

Logging In ASP.Net Core 1.1.

Similar presentations


Presentation on theme: "Logging In ASP.Net Core 1.1."— Presentation transcript:

1 Logging In ASP.Net Core 1.1

2 Logging Your program (web app) will run on a server, 24x7, forever and ever If something goes wrong you want to get useful info about what happened You may not be able to attach the debugger to the web app You may not be able to reproduce the problem Logging: Saving messages for later reference, in order to help you figure out what your program is doing wrong / underperforming / how that hacker broke into your system / etc

3 Tutorial We’ll be walking through:

4 Providers “A logging provider takes some action on logged data, such as display it on the console or store it in Azure blob storage. ” Examples of providers: Print it to the console (just like Console.WriteLine) Save it to a file Save it to a database Save it to Azure (aka “save it to a file/database in the cloud”) Built-in providers: logging-providers You can also use 3rd party providers (your own, or written by someone else)

5 Providers Let’s add in the Console & Debugger providers, as per that first step in the turorial

6 Adding Items To The Log(s)
<Let’s look a the sample code in “How to create logs”> Let’s go through “Sample logging output”

7 Adding Items To The Log(s)
Categories So you know where the message is coming from Log Level You can specify how important it is to see the message You can then tell the logger what level (and above) you want to see This way you can put a ton of messages in at the ‘Debug’ (lowest) level, set the level to display higher for day-to-day use, and only see critical messages normally. Once you know there’s a bug you can change the log level to be ‘debug’ to get detailed information (for debugging purposes) This is covered in the “Log filtering” section

8 Let’s Add Logging To Your App


Download ppt "Logging In ASP.Net Core 1.1."

Similar presentations


Ads by Google