Tuesday, October 03, 2017

Creating and Reading Application Logs in .NET

An error-free piece of code theoretically should exist, but, in reality, it's almost impossible to test whether an application works under every situation. When errors occur, there are different ways to handle them. As a developer, it's best practice to detect and catch errors and log them as well. For example, performance problems may occur only when your application is dealing with a large data load. To diagnose these errors in a production environment, you need to log errors automatically so they can be reviewed and analyzed at a later time to fix the issue. The .NET Framework provides a wide range of logging options; Windows System Event Log is one of those from your .NET application. As a developer, you can write code to log an error in the Event viewer and gather information about the software problems and monitor system events.

More

No comments:

Post a Comment

Mocking API Responses in Azure API Management Portal

A mock API imitates a real API call by providing a realistic JSON or XML response to the requester. Mock APIs can be designed on a developer...