liveBook · Manning

Centralized logging system

As explained in ASP.NET Core in Action, 3e

Centralized logging is a logging arrangement in which application instances send their logs to a shared location separate from the applications.

A centralized logging system sends logs from every application instance to one shared location outside the applications. This avoids collecting files manually from multiple production servers and reduces dependence on remote access, disk space, and file permissions. section 26.3

The destination can be a cloud provider or a third-party log aggregator. Each application instance uses a logging provider to send messages to the same service, while other providers can continue writing to the console or files. section 26.3

Listing 26.5 Adding a third-party logging provider to WebApplicationBuilder
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);   #1
builder.Logging.AddFile();                                            #2
 
WebApplication app = builder.Build();
 
app.MapGet("/", () => "Hello world!");
 
app.Run();
#1 The WebApplicationBuilder configures the console and debug providers as normal.
#2 Adds the new file logging provider to the logger factory

Adds a third-party logging provider to WebApplicationBuilder with builder.Logging.AddFile(). section 26.3

Common destinations include:

  • Azure App Service, which provides centralized logging through its provider. section 26.3
  • Third-party aggregators such as elmah.io or Seq, added through NuGet logging providers. section 26.3

How ASP.NET Core in Action, 3e covers it

How deep it goes
Explains the arrangement, operational rationale, and provider choices, but defers controlling the volume of production messages.
Examples
Uses Azure App Service, elmah.io, Seq, and an ASP.NET Core WebApplicationBuilder provider configuration.
What it assumes
Assumes familiarity with application logging providers and introduces centralized destinations through practical deployment examples.
What you can do after
Operate/configure ASP.NET Core logging providers that send messages to a shared external destination.
How it connects
Connects logging providers with file logging, Azure App Service, and third-party log aggregator services.

Also explained in

Compare how 3 books explain centralized logging system →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ASP.NET Core in Action, 3e. The section links point to the parts of the book it draws on.