|
11 | 11 | using Microsoft.ApplicationInsights.Channel; |
12 | 12 | using Microsoft.ApplicationInsights.DataContracts; |
13 | 13 | using Microsoft.ApplicationInsights.Extensibility.Implementation; |
| 14 | +using Microsoft.Azure.AppService.Proxy.Common.Expressions; |
14 | 15 | using Microsoft.Azure.WebJobs.Host; |
15 | 16 | using Microsoft.Azure.WebJobs.Logging; |
16 | 17 | using Microsoft.Azure.WebJobs.Script.Diagnostics; |
|
19 | 20 | using Microsoft.Extensions.DependencyInjection; |
20 | 21 | using Microsoft.Extensions.Hosting; |
21 | 22 | using Microsoft.Extensions.Logging; |
| 23 | +using Microsoft.Extensions.Logging.Abstractions.Internal; |
22 | 24 | using Microsoft.WebJobs.Script.Tests; |
23 | 25 | using Newtonsoft.Json.Linq; |
24 | 26 | using Xunit; |
@@ -251,12 +253,17 @@ public async Task Validate_HostLogs() |
251 | 253 | // Validate the host startup traces. Order by message string as the requests may come in |
252 | 254 | // slightly out-of-order or on different threads |
253 | 255 | TraceTelemetry[] traces = null; |
| 256 | + string routesManagerLogCategory = TypeNameHelper.GetTypeDisplayName(typeof(WebHost.WebScriptHostHttpRoutesManager)); |
254 | 257 |
|
255 | 258 | await TestHelpers.Await(() => |
256 | 259 | { |
257 | 260 | traces = _fixture.Channel.Telemetries |
258 | 261 | .OfType<TraceTelemetry>() |
259 | | - .Where(t => t.Properties[LogConstants.CategoryNameKey].ToString().StartsWith("Host.")) |
| 262 | + .Where(t => |
| 263 | + { |
| 264 | + string category = t.Properties[LogConstants.CategoryNameKey].ToString(); |
| 265 | + return category.StartsWith("Host.") || category.StartsWith(routesManagerLogCategory); |
| 266 | + }) |
260 | 267 | .OrderBy(t => t.Message) |
261 | 268 | .ToArray(); |
262 | 269 |
|
@@ -287,7 +294,7 @@ await TestHelpers.Await(() => |
287 | 294 | ValidateTrace(traces[idx++], "Host lock lease acquired by instance ID", ScriptConstants.LogCategoryHostGeneral); |
288 | 295 | ValidateTrace(traces[idx++], "Host started (", LogCategories.Startup); |
289 | 296 | ValidateTrace(traces[idx++], "Initializing function HTTP routes" + Environment.NewLine |
290 | | - + "Mapped function route 'api/HttpTrigger-Scenarios'", "Host.HttpRoutes"); |
| 297 | + + "Mapped function route 'api/HttpTrigger-Scenarios'", routesManagerLogCategory); |
291 | 298 | ValidateTrace(traces[idx++], "Initializing Host", LogCategories.Startup); |
292 | 299 | ValidateTrace(traces[idx++], "Initializing Warmup Extension", LogCategories.CreateTriggerCategory("Warmup")); |
293 | 300 | ValidateTrace(traces[idx++], "Job host started", LogCategories.Startup); |
|
0 commit comments