Skip to content

Commit 108ac1f

Browse files
author
Collin Stevens
authored
Update high-performance-logging.md (dotnet#31750)
1 parent 603ea66 commit 108ac1f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/core/extensions/high-performance-logging.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ The <xref:Microsoft.Extensions.Logging.LoggerMessage> class exposes functionalit
1515
- Logger extension methods require "boxing" (converting) value types, such as `int`, into `object`. The <xref:Microsoft.Extensions.Logging.LoggerMessage> pattern avoids boxing by using static <xref:System.Action> fields and extension methods with strongly typed parameters.
1616
- Logger extension methods must parse the message template (named format string) every time a log message is written. <xref:Microsoft.Extensions.Logging.LoggerMessage> only requires parsing a template once when the message is defined.
1717

18+
> [!IMPORTANT]
19+
> Instead of using the [LoggerMessage class](xref:Microsoft.Extensions.Logging.LoggerMessage) to create high-performance logs, you can use the [LoggerMessage attribute](xref:Microsoft.Extensions.Logging.LoggerMessageAttribute) in .NET 6.0. The `LoggerMessageAttribute` provides source-generation logging support designed to deliver a highly usable and highly performant logging solution for modern .NET applications. For more information, see [Compile-time logging source generation (.NET Fundamentals)](./logger-message-generator.md).
20+
1821
The sample app demonstrates <xref:Microsoft.Extensions.Logging.LoggerMessage> features with a priority queue processing worker service. The app processes work items in priority order. As these operations occur, log messages are generated using the <xref:Microsoft.Extensions.Logging.LoggerMessage> pattern.
1922

2023
[!INCLUDE [logging-samples-browser](includes/logging-samples-browser.md)]

0 commit comments

Comments
 (0)