Skip to content

ShawnShiSS/aspnetcore-api-serilog

Repository files navigation

ASP.NET Core API - Serilog

A start project for ASP.NET Core API with Serilog configured.

Goals

This sample project is used to demonstrate how to add Serilog for structured logging in a barebones ASP.NET Core API project.

Serilog provides structured data logging to files, to the console, to persistence store like SQL Server, to Email, etc..

Getting Started

You should be able to clone the repo and start running it in Visual Studio right away.

Additional Notes

This sample is related to another project Clean Architecture with partitioned repository pattern using Azure Cosmos DB, which is an ongoing start project aimed to showcase the following items:

  • Clean Architecture
  • ASP.NET Core 3.1
  • Azure Cosmos DB .NET SDK V3
  • Repository Design Pattern
  • Partition Key
  • REST API
  • Swagger UI
  • OData support
  • IMemoryCache Cache service (Non-distributed in-memory cache)
  • Serilog for structured logging
  • MediatR Command/Query pattern
  • MediatR pipeline behaviour for exception handling
  • FluentValidation for validation
  • AutoMapper to mapping
  • Database initial creation
  • Sample data seeding
  • Email Sender
  • ASP.NET Core Identity
  • Identity Service
  • LINQ support vs CosmosDB Client
  • Cosmos DB Change Feed
  • etc.

TODOs

  • Add appsettings.Production.json for deployment on Azure App Service

Releases

No releases published

Packages

No packages published

Languages