@@ -47,7 +47,7 @@ public MessagePump(IOptions<HttpSysOptions> options, ILoggerFactory loggerFactor
47
47
}
48
48
_options = options . Value ;
49
49
Listener = new HttpSysListener ( _options , loggerFactory ) ;
50
- _logger = LogHelper . CreateLogger ( loggerFactory , typeof ( MessagePump ) ) ;
50
+ _logger = loggerFactory . CreateLogger < MessagePump > ( ) ;
51
51
52
52
if ( _options . Authentication . Schemes != AuthenticationSchemes . None )
53
53
{
@@ -83,7 +83,7 @@ public Task StartAsync<TContext>(IHttpApplication<TContext> application, Cancell
83
83
{
84
84
if ( _options . UrlPrefixes . Count > 0 )
85
85
{
86
- LogHelper . LogWarning ( _logger , $ "Overriding endpoints added to { nameof ( HttpSysOptions . UrlPrefixes ) } since { nameof ( IServerAddressesFeature . PreferHostingUrls ) } is set to true." +
86
+ _logger . LogWarning ( $ "Overriding endpoints added to { nameof ( HttpSysOptions . UrlPrefixes ) } since { nameof ( IServerAddressesFeature . PreferHostingUrls ) } is set to true." +
87
87
$ " Binding to address(es) '{ string . Join ( ", " , _serverAddresses . Addresses ) } ' instead. ") ;
88
88
89
89
Listener . Options . UrlPrefixes . Clear ( ) ;
@@ -95,7 +95,7 @@ public Task StartAsync<TContext>(IHttpApplication<TContext> application, Cancell
95
95
{
96
96
if ( hostingUrlsPresent )
97
97
{
98
- LogHelper . LogWarning ( _logger , $ "Overriding address(es) '{ string . Join ( ", " , _serverAddresses . Addresses ) } '. " +
98
+ _logger . LogWarning ( $ "Overriding address(es) '{ string . Join ( ", " , _serverAddresses . Addresses ) } '. " +
99
99
$ "Binding to endpoints added to { nameof ( HttpSysOptions . UrlPrefixes ) } instead.") ;
100
100
101
101
_serverAddresses . Addresses . Clear ( ) ;
@@ -108,7 +108,7 @@ public Task StartAsync<TContext>(IHttpApplication<TContext> application, Cancell
108
108
}
109
109
else if ( Listener . RequestQueue . Created )
110
110
{
111
- LogHelper . LogDebug ( _logger , $ "No listening endpoints were configured. Binding to { Constants . DefaultServerAddress } by default.") ;
111
+ _logger . LogDebug ( $ "No listening endpoints were configured. Binding to { Constants . DefaultServerAddress } by default.") ;
112
112
113
113
Listener . Options . UrlPrefixes . Add ( Constants . DefaultServerAddress ) ;
114
114
}
@@ -171,11 +171,11 @@ private async void ProcessRequestsWorker()
171
171
Contract . Assert ( Stopping ) ;
172
172
if ( Stopping )
173
173
{
174
- LogHelper . LogDebug ( _logger , "ListenForNextRequestAsync-Stopping" , exception ) ;
174
+ _logger . LogDebug ( 0 , exception , "ListenForNextRequestAsync-Stopping" ) ;
175
175
}
176
176
else
177
177
{
178
- LogHelper . LogException ( _logger , "ListenForNextRequestAsync" , exception ) ;
178
+ _logger . LogError ( 0 , exception , "ListenForNextRequestAsync" ) ;
179
179
}
180
180
continue ;
181
181
}
@@ -187,7 +187,7 @@ private async void ProcessRequestsWorker()
187
187
{
188
188
// Request processing failed to be queued in threadpool
189
189
// Log the error message, release throttle and move on
190
- LogHelper . LogException ( _logger , "ProcessRequestAsync" , ex ) ;
190
+ _logger . LogError ( 0 , ex , "ProcessRequestAsync" ) ;
191
191
}
192
192
}
193
193
Interlocked . Decrement ( ref _acceptorCounts ) ;
@@ -224,7 +224,7 @@ private async void ProcessRequestAsync(object requestContextObj)
224
224
}
225
225
catch ( Exception ex )
226
226
{
227
- LogHelper . LogException ( _logger , "ProcessRequestAsync" , ex ) ;
227
+ _logger . LogError ( 0 , ex , "ProcessRequestAsync" ) ;
228
228
_application . DisposeContext ( context , ex ) ;
229
229
if ( requestContext . Response . HasStarted )
230
230
{
@@ -247,14 +247,14 @@ private async void ProcessRequestAsync(object requestContextObj)
247
247
{
248
248
if ( Interlocked . Decrement ( ref _outstandingRequests ) == 0 && Stopping )
249
249
{
250
- LogHelper . LogInfo ( _logger , "All requests drained." ) ;
250
+ _logger . LogInformation ( "All requests drained." ) ;
251
251
_shutdownSignal . TrySetResult ( 0 ) ;
252
252
}
253
253
}
254
254
}
255
255
catch ( Exception ex )
256
256
{
257
- LogHelper . LogException ( _logger , "ProcessRequestAsync" , ex ) ;
257
+ _logger . LogError ( 0 , ex , "ProcessRequestAsync" ) ;
258
258
requestContext . Abort ( ) ;
259
259
}
260
260
}
@@ -274,7 +274,7 @@ void RegisterCancelation()
274
274
{
275
275
if ( Interlocked . Exchange ( ref _shutdownSignalCompleted , 1 ) == 0 )
276
276
{
277
- LogHelper . LogInfo ( _logger , "Canceled, terminating " + _outstandingRequests + " request(s)." ) ;
277
+ _logger . LogInformation ( "Canceled, terminating " + _outstandingRequests + " request(s)." ) ;
278
278
_shutdownSignal . TrySetResult ( null ) ;
279
279
}
280
280
} ) ;
@@ -292,7 +292,7 @@ void RegisterCancelation()
292
292
// Wait for active requests to drain
293
293
if ( _outstandingRequests > 0 )
294
294
{
295
- LogHelper . LogInfo ( _logger , "Stopping, waiting for " + _outstandingRequests + " request(s) to drain." ) ;
295
+ _logger . LogInformation ( "Stopping, waiting for " + _outstandingRequests + " request(s) to drain." ) ;
296
296
RegisterCancelation ( ) ;
297
297
}
298
298
else
0 commit comments