Skip to content

Commit 77520d2

Browse files
Update logging.md (#43808)
updating highlighted line after code format.
1 parent 8187638 commit 77520d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/core/extensions/logging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ If your application is using [Dependency Injection (DI)](dependency-injection.md
6060

6161
This example gets an ILogger object in a hosted app using [ASP.NET Minimal APIs](/aspnet/core/fundamentals/minimal-apis/overview):
6262

63-
:::code language="csharp" source="snippets/logging/minimal-web/Program.cs" highlight="8":::
63+
:::code language="csharp" source="snippets/logging/minimal-web/Program.cs" highlight="12":::
6464

6565
The preceding example:
6666

6767
- Created a singleton service called `ExampleHandler` and mapped incoming web requests to run the `ExampleHandler.HandleRequest` function.
68-
- Line 8 defines a [primary constructor](../../csharp/whats-new/tutorials/primary-constructors.md) for the ExampleHandler, a feature added in C# 12. Using the older style C# constructor would work equally well but is a little more verbose.
68+
- Line 12 defines a [primary constructor](../../csharp/whats-new/tutorials/primary-constructors.md) for the ExampleHandler, a feature added in C# 12. Using the older style C# constructor would work equally well but is a little more verbose.
6969
- The constructor defines a parameter of type `ILogger<ExampleHandler>`. <xref:Microsoft.Extensions.Logging.ILogger%601> derives from <xref:Microsoft.Extensions.Logging.ILogger> and indicates which category the `ILogger` object has. The DI container locates an `ILogger` with the correct category and supplies it as the constructor argument. If no `ILogger` with that category exists yet, the DI container automatically creates it from the `ILoggerFactory` in the service provider.
7070
- The `logger` parameter received in the constructor was used for logging in the `HandleRequest` function.
7171

0 commit comments

Comments
 (0)