Skip to content

Commit 6b87ce8

Browse files
authored
Use simpler delegate when constructing AzureEventSourceListener (Azure#46202)
* Use simpler delegate when constructing AzureEventSourceListener * Updated CHANGELOGs
1 parent e649b24 commit 6b87ce8

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

sdk/extensions/Microsoft.Extensions.Azure/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
### Other Changes
1212

13+
- Improved the efficiency of `AzureEventSourceLogForwarder` by eliminating message formatting. ([#46202](https://github.com/Azure/azure-sdk-for-net/pull/46202))
14+
1315
## 1.7.5 (2024-08-15)
1416

1517
### Other Changes

sdk/extensions/Microsoft.Extensions.Azure/src/AzureEventSourceLogForwarder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public AzureEventSourceLogForwarder(ILoggerFactory loggerFactory)
3737
/// </summary>
3838
public void Start()
3939
{
40-
_listener ??= new AzureEventSourceListener((e, s) => LogEvent(e), EventLevel.Verbose);
40+
_listener ??= new AzureEventSourceListener(LogEvent, EventLevel.Verbose);
4141
}
4242

4343
private void LogEvent(EventWrittenEventArgs eventData)

sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
.NET](https://learn.microsoft.com/dotnet/azure/sdk/logging).
3333
([#45649](https://github.com/Azure/azure-sdk-for-net/pull/45649))
3434

35+
* Improved the efficiency of `AzureEventSourceLogForwarder` by eliminating message formatting. ([#46202](https://github.com/Azure/azure-sdk-for-net/pull/46202))
36+
3537
## 1.3.0-beta.1 (2024-07-12)
3638

3739
### Bugs Fixed

sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Internals/AzureSdkCompat/AzureEventSourceLogForwarder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public Task StartAsync(CancellationToken cancellationToken)
7979
{
8080
// Setting even a single custom filter for Azure SDK logs will reset the default warning level and switch to listening at the verbose level.
8181
// This gives the customer full control over the log levels for all Azure SDK components.
82-
_listener ??= new AzureEventSourceListener((e, s) => LogEvent(e), _hasAzureLoggerFilterOptionsRules ? EventLevel.Verbose : EventLevel.Warning);
82+
_listener ??= new AzureEventSourceListener(LogEvent, _hasAzureLoggerFilterOptionsRules ? EventLevel.Verbose : EventLevel.Warning);
8383
}
8484

8585
return Task.CompletedTask;

0 commit comments

Comments
 (0)