1 write to Category
Microsoft.Extensions.Diagnostics.Testing (1)
Logging\FakeLogRecord.cs (1)
38
Category
= category;
66 references to Category
Aspire.Hosting.Testing.Tests (6)
ResourceLoggerForwarderServiceTests.cs (6)
119
log => { Assert.Equal(LogLevel.Information, log.Level); Assert.Equal("1: 2000-12-29T20:59:59.0000000Z Test trace message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.
Category
); },
120
log => { Assert.Equal(LogLevel.Information, log.Level); Assert.Equal("2: 2000-12-29T20:59:59.0000000Z Test debug message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.
Category
); },
121
log => { Assert.Equal(LogLevel.Information, log.Level); Assert.Equal("3: 2000-12-29T20:59:59.0000000Z Test information message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.
Category
); },
122
log => { Assert.Equal(LogLevel.Information, log.Level); Assert.Equal("4: 2000-12-29T20:59:59.0000000Z Test warning message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.
Category
); },
123
log => { Assert.Equal(LogLevel.Error, log.Level); Assert.Equal("5: 2000-12-29T20:59:59.0000000Z Test error message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.
Category
); },
124
log => { Assert.Equal(LogLevel.Error, log.Level); Assert.Equal("6: 2000-12-29T20:59:59.0000000Z Test critical message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.
Category
); });
Aspire.Playground.Tests (4)
Infrastructure\DistributedApplicationExtensions.cs (4)
116
var appHostLogs = logs.Where(l => l.
Category
?.StartsWith($"{environment.ApplicationName}.Resources") == false).ToList();
117
var resourceLogs = logs.Where(l => l.
Category
?.StartsWith($"{environment.ApplicationName}.Resources") == true).ToList();
139
AssertDoesNotContain(appHostlogs, log => log.Level >= LogLevel.Error && log.
Category
!= "Microsoft.Extensions.Diagnostics.HealthChecks.DefaultHealthCheckService");
140
AssertDoesNotContain(resourceLogs, log => log.
Category
is { Length: > 0 } category && assertableResourceLogNames.Contains(category) && log.Level >= LogLevel.Error);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (17)
Logging\AcceptanceTests.cs (11)
181
Assert.Equal(LoggingCategory, logCollector.LatestRecord.
Category
);
241
Assert.Equal(LoggingCategory, logCollector.LatestRecord.
Category
);
307
Assert.All(logRecords, x => Assert.Equal(LoggingCategory, x.
Category
));
369
Assert.Equal(LoggingCategory, lastRecord.
Category
);
415
Assert.Equal(LoggingCategory, logCollector.LatestRecord.
Category
);
457
Assert.Equal(LoggingCategory, logCollector.LatestRecord.
Category
);
488
Assert.All(logRecords, x => Assert.Equal(LoggingCategory, x.
Category
));
526
Assert.All(logRecords, x => Assert.Equal(LoggingCategory, x.
Category
));
574
Assert.Equal(LoggingCategory, logCollector.LatestRecord.
Category
);
615
Assert.Equal(LoggingCategory, logCollector.LatestRecord.
Category
);
649
Assert.Equal(LoggingCategory, logCollector.LatestRecord.
Category
);
Logging\AcceptanceTests.Mvc.cs (5)
74
Assert.Equal(LoggingCategory, logRecord.
Category
);
109
Assert.Equal(LoggingCategory, logRecord.
Category
);
155
Assert.Equal(LoggingCategory, logRecord.
Category
);
199
Assert.Equal(LoggingCategory, logRecord.
Category
);
240
Assert.Equal(LoggingCategory, logRecord.
Category
);
Logging\AcceptanceTests.Routing.cs (1)
74
Assert.Equal(LoggingCategory, logRecord.
Category
);
Microsoft.Extensions.Diagnostics.Testing (2)
Logging\FakeLogCollector.cs (2)
119
if (record.
Category
== null || !_options.FilteredCategories.Contains(record.
Category
))
Microsoft.Extensions.Diagnostics.Testing.Tests (8)
Logging\FakeLoggerProviderTests.cs (5)
20
Assert.Equal("Storage", logger.LatestRecord.
Category
);
26
Assert.Null(logger.LatestRecord.
Category
);
32
Assert.Equal("Microsoft.Extensions.Logging.Testing.Test.Logging.FakeLoggerProviderTests", logger.LatestRecord.
Category
);
49
Assert.Null(records[0].
Category
);
50
Assert.Equal("Storage", records[1].
Category
);
Logging\FakeLoggerTests.cs (3)
39
Assert.Null(records[0].
Category
);
48
Assert.Null(records[0].
Category
);
56
Assert.Null(logger.LatestRecord.
Category
);
Microsoft.Extensions.Http.Diagnostics.Tests (15)
Logging\AcceptanceTests.cs (15)
46
Assert.Equal(LoggingCategory, logRecord.
Category
);
78
Assert.Equal(LoggingCategory, firstLogRecord.
Category
);
87
Assert.Equal(LoggingCategory, secondLogRecord.
Category
);
115
var logRecord = collector.GetSnapshot().Single(logRecord => logRecord.
Category
== LoggingCategory);
172
var logRecord = collector.GetSnapshot().Single(l => l.
Category
== LoggingCategory);
188
logRecord = collector.GetSnapshot().Single(l => l.
Category
== LoggingCategory);
258
var logRecord = collector.GetSnapshot().Single(l => l.
Category
== LoggingCategory);
280
logRecord = collector.GetSnapshot().Single(l => l.
Category
== LoggingCategory);
323
var logRecord = collector.GetSnapshot().Single(logRecord => logRecord.
Category
== LoggingCategory);
366
var logRecord = collector.GetSnapshot().Single(logRecord => logRecord.
Category
== LoggingCategory);
435
var logRecord = collector.GetSnapshot().Single(logRecord => logRecord.
Category
== LoggingCategory);
595
var logRecord = collector.GetSnapshot().Single(l => l.
Category
== LoggingCategory);
621
var logRecords = collector.GetSnapshot().Where(l => l.
Category
== "System.Net.Http.HttpClient.normal.LogicalHandler").ToList();
644
var logRecord = collector.GetSnapshot().Single(l => l.
Category
== LoggingCategory);
696
var logRecord = collector.GetSnapshot().Single(l => l.
Category
== LoggingCategory);
Microsoft.Extensions.Telemetry.Tests (14)
Logging\ExtendedLoggerTests.cs (14)
77
Assert.Equal(Category, snap[0].
Category
);
93
Assert.Equal(Category, snap[1].
Category
);
162
Assert.Equal(Category, snap[0].
Category
);
169
Assert.Equal(Category, snap[1].
Category
);
227
Assert.Equal(Category, snap[0].
Category
);
234
Assert.Equal(Category, snap[1].
Category
);
241
Assert.Equal(Category, snap[2].
Category
);
248
Assert.Equal(Category, snap[3].
Category
);
287
Assert.Equal(Category, snap[0].
Category
);
356
Assert.Equal(Category, snap[0].
Category
);
465
Assert.Equal(Category, snap[0].
Category
);
470
Assert.Equal(Category, snap[1].
Category
);
475
Assert.Equal(Category, snap[2].
Category
);
480
Assert.Equal(Category, snap[3].
Category
);