diff --git a/build/Common.props b/build/Common.props index 564a64f1e27..59c3ee2622f 100644 --- a/build/Common.props +++ b/build/Common.props @@ -25,7 +25,7 @@ net8.0;net7.0;net6.0 net8.0 - net7.0;net6.0 + net8.0;net7.0;net6.0 $(TargetFrameworksForDocs);net481;net48;net472;net471;net47;net462 diff --git a/docs/logs/getting-started-aspnetcore/Program.cs b/docs/logs/getting-started-aspnetcore/Program.cs index abb7a756386..f1e301c616c 100644 --- a/docs/logs/getting-started-aspnetcore/Program.cs +++ b/docs/logs/getting-started-aspnetcore/Program.cs @@ -56,9 +56,9 @@ public static partial class ApplicationLogs { - [LoggerMessage(EventId = 1, Level = LogLevel.Information, Message = "Starting the app...")] + [LoggerMessage(LogLevel.Information, "Starting the app...")] public static partial void StartingApp(this ILogger logger); - [LoggerMessage(EventId = 2, Level = LogLevel.Information, Message = "Food `{name}` price changed to `{price}`.")] + [LoggerMessage(LogLevel.Information, "Food `{name}` price changed to `{price}`.")] public static partial void FoodPriceChanged(this ILogger logger, string name, double price); } diff --git a/docs/logs/getting-started-aspnetcore/README.md b/docs/logs/getting-started-aspnetcore/README.md index bce211dc821..463325c3d9e 100644 --- a/docs/logs/getting-started-aspnetcore/README.md +++ b/docs/logs/getting-started-aspnetcore/README.md @@ -35,7 +35,7 @@ LogRecord.SeverityText: Information LogRecord.Body: Starting the app... LogRecord.Attributes (Key:Value): OriginalFormat (a.k.a Body): Starting the app... -LogRecord.EventId: 1 +LogRecord.EventId: 225744744 LogRecord.EventName: StartingApp ... @@ -65,7 +65,7 @@ LogRecord.Attributes (Key:Value): name: artichoke price: 9.99 OriginalFormat (a.k.a Body): Food `{name}` price changed to `{price}`. -LogRecord.EventId: 2 +LogRecord.EventId: 344095174 LogRecord.EventName: FoodPriceChanged ... @@ -110,10 +110,10 @@ logging, and type-checked parameters: ```csharp public static partial class ApplicationLogs { - [LoggerMessage(EventId = 1, Level = LogLevel.Information, Message = "Starting the app...")] + [LoggerMessage(LogLevel.Information, "Starting the app...")] public static partial void StartingApp(this ILogger logger); - [LoggerMessage(EventId = 2, Level = LogLevel.Information, Message = "Food `{name}` price changed to `{price}`.")] + [LoggerMessage(LogLevel.Information, "Food `{name}` price changed to `{price}`.")] public static partial void FoodPriceChanged(this ILogger logger, string name, double price); } ``` diff --git a/docs/logs/getting-started-aspnetcore/getting-started-aspnetcore.csproj b/docs/logs/getting-started-aspnetcore/getting-started-aspnetcore.csproj index cebc8460c42..78fae771881 100644 --- a/docs/logs/getting-started-aspnetcore/getting-started-aspnetcore.csproj +++ b/docs/logs/getting-started-aspnetcore/getting-started-aspnetcore.csproj @@ -1,5 +1,6 @@ + diff --git a/docs/logs/getting-started-console/Program.cs b/docs/logs/getting-started-console/Program.cs index 73802759126..9d0ef0e653e 100644 --- a/docs/logs/getting-started-console/Program.cs +++ b/docs/logs/getting-started-console/Program.cs @@ -30,7 +30,6 @@ logger.FoodPriceChanged("artichoke", 9.99); logger.FoodRecallNotice( - logLevel: LogLevel.Critical, brandName: "Contoso", productDescription: "Salads", productType: "Food & Beverages", @@ -43,13 +42,12 @@ public static partial class ApplicationLogs { - [LoggerMessage(EventId = 1, Level = LogLevel.Information, Message = "Food `{name}` price changed to `{price}`.")] + [LoggerMessage(LogLevel.Information, "Food `{name}` price changed to `{price}`.")] public static partial void FoodPriceChanged(this ILogger logger, string name, double price); - [LoggerMessage(EventId = 2, Message = "A `{productType}` recall notice was published for `{brandName} {productDescription}` produced by `{companyName}` ({recallReasonDescription}).")] + [LoggerMessage(LogLevel.Critical, "A `{productType}` recall notice was published for `{brandName} {productDescription}` produced by `{companyName}` ({recallReasonDescription}).")] public static partial void FoodRecallNotice( this ILogger logger, - LogLevel logLevel, string brandName, string productDescription, string productType, diff --git a/docs/logs/getting-started-console/README.md b/docs/logs/getting-started-console/README.md index f45c2c5c107..65b836c19f5 100644 --- a/docs/logs/getting-started-console/README.md +++ b/docs/logs/getting-started-console/README.md @@ -43,7 +43,7 @@ LogRecord.Attributes (Key:Value): name: artichoke price: 9.99 OriginalFormat (a.k.a Body): Food `{name}` price changed to `{price}`. -LogRecord.EventId: 1 +LogRecord.EventId: 344095174 LogRecord.EventName: FoodPriceChanged ... @@ -60,7 +60,7 @@ LogRecord.Attributes (Key:Value): recallReasonDescription: due to a possible health risk from Listeria monocytogenes companyName: Contoso Fresh Vegetables, Inc. OriginalFormat (a.k.a Body): A `{productType}` recall notice was published for `{brandName} {productDescription}` produced by `{companyName}` ({recallReasonDescription}). -LogRecord.EventId: 2 +LogRecord.EventId: 1338249384 LogRecord.EventName: FoodRecallNotice ... @@ -93,7 +93,7 @@ logging, and type-checked parameters: ```csharp public static partial class ApplicationLogs { - [LoggerMessage(EventId = 1, Level = LogLevel.Information, Message = "Food `{name}` price changed to `{price}`.")] + [LoggerMessage(LogLevel.Information, "Food `{name}` price changed to `{price}`.")] public static partial void FoodPriceChanged(this ILogger logger, string name, double price); ... diff --git a/docs/logs/redaction/Program.cs b/docs/logs/redaction/Program.cs index 0e3e971bf89..3b75b689c6f 100644 --- a/docs/logs/redaction/Program.cs +++ b/docs/logs/redaction/Program.cs @@ -37,6 +37,6 @@ public static partial class ApplicationLogs { - [LoggerMessage(EventId = 1, Level = LogLevel.Information, Message = "Food `{name}` price changed to `{price}`.")] + [LoggerMessage(LogLevel.Information, "Food `{name}` price changed to `{price}`.")] public static partial void FoodPriceChanged(this ILogger logger, string name, double price); }