@@ -20,6 +20,7 @@ namespace Microsoft.DurableTask.Worker.Grpc.Tests;
2020public class LoggingCategoryTests
2121{
2222 const string NewGrpcCategory = "Microsoft.DurableTask.Worker.Grpc" ;
23+ const string LegacyCategory = "Microsoft.DurableTask" ;
2324
2425 [ Fact ]
2526 public void Worker_UsesLegacyCategories_ByDefault ( )
@@ -195,14 +196,14 @@ public void GrpcDurableTaskWorker_EmitsToBothCategories_WhenLegacyCategoriesEnab
195196 ILogger testLogger = loggerFactory . CreateLogger ( NewGrpcCategory ) ;
196197 testLogger . LogInformation ( "Integration test log" ) ;
197198
198- ILogger legacyLogger = loggerFactory . CreateLogger ( "Microsoft.DurableTask" ) ;
199+ ILogger legacyLogger = loggerFactory . CreateLogger ( LegacyCategory ) ;
199200 legacyLogger . LogInformation ( "Integration test log" ) ;
200201
201202 // Assert - verify both categories receive logs
202203 logProvider . TryGetLogs ( NewGrpcCategory , out var newLogs ) . Should ( ) . BeTrue ( "new category logger should receive logs" ) ;
203204 newLogs . Should ( ) . NotBeEmpty ( "logs should be written to new category" ) ;
204205
205- logProvider . TryGetLogs ( "Microsoft.DurableTask" , out var legacyLogs ) . Should ( ) . BeTrue ( "legacy category logger should receive logs" ) ;
206+ logProvider . TryGetLogs ( LegacyCategory , out var legacyLogs ) . Should ( ) . BeTrue ( "legacy category logger should receive logs" ) ;
206207 legacyLogs . Should ( ) . NotBeEmpty ( "logs should be written to legacy category" ) ;
207208 }
208209
@@ -245,7 +246,7 @@ public void GrpcDurableTaskWorker_EmitsToNewCategoryOnly_WhenLegacyCategoriesDis
245246 // Verify we didn't create a legacy logger (by checking directly)
246247 // The TestLogProvider uses StartsWith, so we check that no logs exist with exactly the legacy category
247248 var allLogs = newLogs . ToList ( ) ;
248- allLogs . Should ( ) . NotContain ( log => log . Category == "Microsoft.DurableTask" ,
249+ allLogs . Should ( ) . NotContain ( log => log . Category == LegacyCategory ,
249250 "no logs should have exactly the legacy category when disabled" ) ;
250251 }
251252
0 commit comments