diff --git a/aspnetcore/fundamentals/logging/index.md b/aspnetcore/fundamentals/logging/index.md index 3fcf0b2030..1d8cd4d75f 100644 --- a/aspnetcore/fundamentals/logging/index.md +++ b/aspnetcore/fundamentals/logging/index.md @@ -4,7 +4,7 @@ author: tdykstra description: Learn about the logging framework in ASP.NET Core. Discover the built-in logging providers and learn more about popular third-party providers. ms.author: tdykstra ms.custom: mvc -ms.date: 05/01/2019 +ms.date: 07/11/2019 uid: fundamentals/logging/index --- # Logging in ASP.NET Core @@ -45,7 +45,7 @@ If you use `CreateDefaultBuilder`, you can replace the default providers with yo To use a provider, install its NuGet package and call the provider's extension method on an instance of : -[!code-csharp[](index/samples/1.x/TodoApiSample//Startup.cs?name=snippet_AddConsoleAndDebug&highlight=3,5-7)] +[!code-csharp[](index/samples/1.x/TodoApiSample/Startup.cs?name=snippet_AddConsoleAndDebug&highlight=3,5-7)] ASP.NET Core [dependency injection (DI)](xref:fundamentals/dependency-injection) provides the `ILoggerFactory` instance. The `AddConsole` and `AddDebug` extension methods are defined in the [Microsoft.Extensions.Logging.Console](https://www.nuget.org/packages/Microsoft.Extensions.Logging.Console/) and [Microsoft.Extensions.Logging.Debug](https://www.nuget.org/packages/Microsoft.Extensions.Logging.Debug/) packages. Each extension method calls the `ILoggerFactory.AddProvider` method, passing in an instance of the provider. @@ -639,6 +639,8 @@ loggerFactory.AddConsole(); [AddConsole overloads](xref:Microsoft.Extensions.Logging.ConsoleLoggerExtensions) let you pass in a minimum log level, a filter function, and a boolean that indicates whether scopes are supported. Another option is to pass in an `IConfiguration` object, which can specify scopes support and logging levels. +For Console provider options, see . + The console provider has a significant impact on performance and is generally not appropriate for use in production. When you create a new project in Visual Studio, the `AddConsole` method looks like this: @@ -649,7 +651,7 @@ loggerFactory.AddConsole(Configuration.GetSection("Logging")); This code refers to the `Logging` section of the *appSettings.json* file: -[!code-json[](index/samples/1.x/TodoApiSample//appsettings.json)] +[!code-json[](index/samples/1.x/TodoApiSample/appsettings.json)] The settings shown limit framework logs to warnings while allowing the app to log at debug level, as explained in the [Log filtering](#log-filtering) section. For more information, see [Configuration](xref:fundamentals/configuration/index).