Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building RESTful Web Services with .NET Core

You're reading from  Building RESTful Web Services with .NET Core

Product type Book
Published in May 2018
Publisher Packt
ISBN-13 9781788291576
Pages 334 pages
Edition 1st Edition
Languages
Authors (2):
Gaurav Aroraa Gaurav Aroraa
Profile icon Gaurav Aroraa
Tadit Dash Tadit Dash
Profile icon Tadit Dash
View More author details
Toc

Table of Contents (13) Chapters close

Preface 1. Getting Started 2. Building the Initial Framework – Laying the Foundation of the Application 3. User Registration and Administration 4. Item Catalogue, Cart, and Checkout 5. Integrating External Components and Handling 6. Testing RESTful Web Services 7. Continuous Integration and Continuous Deployment 8. Securing RESTful Web Services 9. Scaling RESTful Services (Performance of Web Services) 10. Building a Web Client (Consuming Web Services) 11. Introduction to Microservices 12. Other Books You May Enjoy

Adding logging to our API in middleware

In simple words, logging is nothing but the process or act of getting log files in one place to get the events or other actions that occur in APIs during communication. In this section, we will implement logging for our product APIs.

Before we start looking at how to log our APIs' events, let's first take a quick look at our existing product APIs.

Refer to the Request delegates section to refresh your memory as to how you can create a new ASP.NET Core project.

The following screenshot shows the project structure of our product APIs:

Here is our Product model:

public class Product
{
public Guid Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Image { get; set; }
public decimal Price { get; set; }
public Guid CategoryId { get; set; }
public virtual Category Category {...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}