Skip to content

Commit 76e05bf

Browse files
authored
Small improvements to logging docs (#19884)
1 parent aa6418e commit 76e05bf

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

aspnetcore/fundamentals/logging/index.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,12 +434,16 @@ Generally, logging should be specified in configuration and not code.
434434

435435
## Built-in logging providers
436436

437-
ASP.NET Core includes the following logging providers:
437+
ASP.NET Core includes the following logging providers as part of the shared framework:
438438

439439
* [Console](#console)
440440
* [Debug](#debug)
441441
* [EventSource](#event-source)
442442
* [EventLog](#welog)
443+
444+
The following logging providers are shipped by Microsoft, but not as part of the
445+
shared framework. They must be installed as additional nuget.
446+
443447
* [AzureAppServicesFile and AzureAppServicesBlob](#azure-app-service)
444448
* [ApplicationInsights](#azure-application-insights)
445449

@@ -758,7 +762,7 @@ The following example creates a logger with `LoggingConsoleApp.Program` as the c
758762

759763
[!code-csharp[](index/samples/3.x/LoggingConsoleApp/Program.cs?name=snippet_LoggerFactory&highlight=14)]
760764

761-
In the following ASP.NET CORE examples, the logger is used to create logs with `Information` as the level. The Log *level* indicates the severity of the logged event.
765+
In the following example, the logger is used to create logs with `Information` as the level. The Log *level* indicates the severity of the logged event.
762766

763767
[!code-csharp[](index/samples/3.x/LoggingConsoleApp/Program.cs?name=snippet_LoggerFactory&highlight=15)]
764768

@@ -1601,6 +1605,7 @@ Navigate to the **Log Stream** page to view app messages. They're logged by the
16011605

16021606
The [Microsoft.Extensions.Logging.ApplicationInsights](https://www.nuget.org/packages/Microsoft.Extensions.Logging.ApplicationInsights) provider package writes logs to Azure Application Insights. Application Insights is a service that monitors a web app and provides tools for querying and analyzing the telemetry data. If you use this provider, you can query and analyze your logs by using the Application Insights tools.
16031607
1608+
The provider package isn't included in the shared framework. To use the provider, add the provider package to the project.
16041609
The logging provider is included as a dependency of [Microsoft.ApplicationInsights.AspNetCore](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore), which is the package that provides all available telemetry for ASP.NET Core. If you use this package, you don't have to install the provider package.
16051610
16061611
Don't use the [Microsoft.ApplicationInsights.Web](https://www.nuget.org/packages/Microsoft.ApplicationInsights.Web) package—that's for ASP.NET 4.x.
@@ -1633,7 +1638,7 @@ Some third-party frameworks can perform [semantic logging, also known as structu
16331638
Using a third-party framework is similar to using one of the built-in providers:
16341639

16351640
1. Add a NuGet package to your project.
1636-
1. Call an `ILoggerFactory` extension method provided by the logging framework.
1641+
1. Call an `ILoggerFactory` or `ILoggingBuilder` extension method provided by the logging framework.
16371642

16381643
For more information, see each provider's documentation. Third-party logging providers aren't supported by Microsoft.
16391644

aspnetcore/fundamentals/logging/index/samples/3.x/LoggingConsoleApp/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Program
55
{
66
static void Main(string[] args)
77
{
8-
var loggerFactory = LoggerFactory.Create(builder =>
8+
using var loggerFactory = LoggerFactory.Create(builder =>
99
{
1010
builder
1111
.AddFilter("Microsoft", LogLevel.Warning)

0 commit comments

Comments
 (0)