liveBook · Manning

AddSimpleConsole

As explained in Building Web APIs with ASP.NET Core

AddSimpleConsole is a .NET logging-builder method that adds and configures the console logging provider.

AddSimpleConsole adds the console logging provider to a .NET logging builder. Its parameterless overload keeps configuration outside Program.cs, while an options overload configures console formatting directly. section 7.2.4

A practical configuration sequence is:

  • Prefer the Logging section in appsettings.json when provider settings should vary without changing Program.cs. section 7.2.4

Provider-specific verbosity

Set MyBGList to Warning inside the Console LogLevel section to suppress an Information-level custom message while retaining the general logging rules.

How Building Web APIs with ASP.NET Core covers it

How deep it goes
Defines parameterless and options overloads, then shifts provider formatting and filtering into appsettings.json.
Examples
Uses single-line timestamps, UTC formatting, console category overrides, and a visible command-prompt log message.
What it assumes
Assumes a logging builder and basic LogLevel configuration, while demonstrating provider registration and filtering.
What you can do after
Operate/configure console logging through Program.cs options or the Logging section of appsettings.json.
How it connects
Connects console logging with logging providers, LogLevel, AddDebug, and appsettings.json configuration.

This explainer was generated by Manning's knowledge graph from the text of Building Web APIs with ASP.NET Core. The section links point to the parts of the book it draws on.