Skip to content

Commit 4e7a25a

Browse files
authored
Disable diagnostic events (#4542)
1 parent 8a877ae commit 4e7a25a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

release_notes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77

88
#### Changes
99

10-
- Fix dotnet templates installation (#5358)
10+
- Fix dotnet templates installation (#4538)
11+
- Disable diagnostic events in local development by replacing the `IDiagnosticEventRepository` with a `DiagnosticEventNullRepository` (#4542)

src/Cli/func/Actions/HostActions/StartHostAction.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
using Microsoft.Azure.WebJobs.Script.Configuration;
2222
using Microsoft.Azure.WebJobs.Script.Description;
2323
using Microsoft.Azure.WebJobs.Script.WebHost;
24+
using Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics;
2425
using Microsoft.Extensions.Configuration;
2526
using Microsoft.Extensions.DependencyInjection;
2627
using Microsoft.Extensions.Logging;
@@ -265,6 +266,9 @@ private async Task<IWebHost> BuildWebHost(ScriptApplicationHostOptions hostOptio
265266
{
266267
services.AddSingleton<IConfigureBuilder<IServiceCollection>>(_ => new DotNetIsolatedDebugConfigureBuilder());
267268
}
269+
270+
// We do not need diagnostic events for local development, so we replace it with a null repository
271+
services.AddSingleton<IDiagnosticEventRepository, DiagnosticEventNullRepository>();
268272
})
269273
.Build();
270274
}

0 commit comments

Comments
 (0)