Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

Commit 3fc2bae

Browse files
committed
Create eventsource early on so that it can be discovered by EventSource.GetSources api
1 parent 219c911 commit 3fc2bae

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Microsoft.AspNetCore.Hosting/Internal/HostingApplication.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ public void DisposeContext(Context context, Exception exception)
7575
{
7676
_diagnosticSource.Write("Microsoft.AspNetCore.Hosting.EndRequest", new { httpContext = httpContext, timestamp = currentTimestamp });
7777
}
78-
79-
HostingEventSource.Log.RequestStop(httpContext);
8078
}
8179
else
8280
{

src/Microsoft.AspNetCore.Hosting/Internal/WebHost.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ public WebHost(
7070
_hostingServiceProvider = hostingServiceProvider;
7171
_applicationServiceCollection.AddSingleton<IApplicationLifetime, ApplicationLifetime>();
7272
_applicationServiceCollection.AddSingleton<HostedServiceExecutor>();
73+
74+
// This is here for the sole reason to load it as fast as possible in the application domain and be found
75+
// by the EventSource.GetSources() api.
76+
var eventSource = HostingEventSource.Log;
7377
}
7478

7579
public IServiceProvider Services

0 commit comments

Comments
 (0)