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

Commit cf3d5da

Browse files
committed
Create eventsource early on so that it can be discovered by EventSource.GetSources api
1 parent 6d2c672 commit cf3d5da

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ public void DisposeContext(Context context, Exception exception)
7171
{
7272
_diagnosticSource.Write("Microsoft.AspNetCore.Hosting.EndRequest", new { httpContext = httpContext, timestamp = currentTimestamp });
7373
}
74-
75-
HostingEventSource.Log.RequestStop(httpContext);
7674
}
7775
else
7876
{

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

+4
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)