Skip to content

Commit dd47ec1

Browse files
committed
Updates example
1 parent 51df5c4 commit dd47ec1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/VariantAndAzureMonitorDemo/LoggerExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ namespace VariantAndAzureMonitorDemo
66
{
77
public static class LoggerExtensions
88
{
9-
private static readonly Action<ILogger, string, Exception?> _vote = LoggerMessage.Define<string>(
9+
private static readonly Action<ILogger, string, int, Exception?> _vote = LoggerMessage.Define<string, int>(
1010
LogLevel.Information,
1111
new EventId(1, "microsoft.custom_event.name"),
12-
"{microsoft.custom_event.name}");
12+
"{microsoft.custom_event.name} {ImageRating}");
1313

1414
private static readonly Action<ILogger, string, string, long, Exception?> _checkout = LoggerMessage.Define<string, string, long>(
1515
LogLevel.Information,
1616
new EventId(1, "microsoft.custom_event.name"),
1717
"{microsoft.custom_event.name} {success} {amount}");
18-
public static void LogVote(this ILogger logger)
18+
public static void LogVote(this ILogger logger, int rating)
1919
{
20-
_vote(logger, "Vote", null);
20+
_vote(logger, "Vote", rating, null);
2121
}
2222

2323
public static void LogCheckout(this ILogger logger, long amount)

examples/VariantAndAzureMonitorDemo/Pages/Index.cshtml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public IActionResult OnPost()
5656
imageRatingHistogram.Record(rating);
5757

5858
// Track the vote event using ILogger custom event
59-
_logger.LogVote();
59+
_logger.LogVote(rating);
6060
}
6161
}
6262

0 commit comments

Comments
 (0)