Sharing Top Content from the Angular-sphere.

.NET Core 2.0, Angular 4 and MySQL. Part 3

  • NET Core has its own implementation of logging messages, but in all my projects, I prefer to create my own custom logger service.
  • If you want to see all the basic instructions and complete navigation for this series, please follow the following link: – – For the previous part check out: – – Source code to download is available at this link: – – This post is divided into several sections: – – Let’s…
  • Our logger service will contain four methods of logging: – – Consequently, you will create an interface ILoggerManager inside Contracts project containing those four method definitions.
  • Add the following code to the ILoggerManager interface: – – Before you implement this interface inside LoggerService project, you need to install NLog library in our LoggerService project.
  • There are three ways to do that: – – So, in ServiceExtensions class add the following method: – – Lastly, in ConfigureServices method invoke this extension method, right above services.AddMvc() with this code: – – Every time you want to use logger service, all you need to do is to…

Why is logging so important during application development? Well, while your application is in developing stage it is very easy to debug the code and to find out what went wrong. But, can you debug in the production environment? Of course not.; Author: Code Maze; Updated: 23 Jan 2018; Section: Universal Windows Platform and Windows Runtime; Chapter: Platforms, Frameworks & Libraries; Updated: 23 Jan 2018

Why is logging so important during application development? Well, while your application is in developing stage it is very easy to debug the code and to find out what went wrong. But, can you debug in the production environment?

Of course not. 

That is why logging messages are a great way to find out what went wrong and where did error happen in your code in the production environment. .NET Core has its own implementation of logging messages, but in all my projects, I prefer to create my own custom logger service. 

This is what I am going to show you in this post.

If you want to see all the basic instructions and complete navigation for this series, please follow the following link: Introduction page for this tutorial.

For the previous part check out: Part 2 – Creating .NET Core WebApi project – Basic code preparations

Source code to download is available at this link: .NET Core, Angular 4 and MySQL. Part 3 – Source Code

This post is divided into several sections:

Let’s create two new projects. Name the first one Contracts. You are going to store interfaces inside this project. Name the second one LoggerService. You are going to use it for logger logic.

To create a new project, right click on solution window, choose Add and then NewProject. Choose under .NET Core, Class Library (.NET Core) and name it Contracts.

Do the same…

.NET Core 2.0, Angular 4 and MySQL. Part 3

Comments are closed, but trackbacks and pingbacks are open.