Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

InDieTasten/DevTease.MicrosoftLoggingExtensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microsoft Logging extensions

1. Common Abstraction

Consisting of:

  • ILogger<>
  • ILoggerProvider
  • ILoggerFactory
  • ILoggingBuilder

Useful for

  • Developers only needing to really learn one abstraction in and out
  • Frameworks neatly plugging into the abstraction (easy to replace frameworks)

2. See initialization in Program.cs

Configuration by default when creating an ASP.NET Core page.

3. See usage of the ILogger interface in HomeController.cs

  • Dependency Injection pattern
  • Clean interface

See here on when to use what log level

4. See configuration in appsettings.(Development).json

Update the minimum log levels for particular categories

5. Adding scopes

Snippet for Console logger to show scopes

"Console": {
    "IncludeScopes": "true"
}

Using the ILogger.BeginScope in the HomeController.Contact action

6. Where to continue

About

Demo project to showcase the Microsoft Logger Extensions and abstractions.

Topics

Resources

Stars

Watchers

Forks

Contributors