From 3f5f0b94ed33c90bb87344516e0ce380bddd7b20 Mon Sep 17 00:00:00 2001 From: Reuben Bond Date: Thu, 4 May 2023 08:02:40 -0700 Subject: [PATCH] Remove Program from Catalog.API --- ...ductPriceChangedIntegrationEventHandler.cs | 2 +- .../Base/BasketScenarioBase.cs | 4 +- .../Catalog/Catalog.API/Catalog.API.csproj | 4 ++ .../CatalogIntegrationEventService.cs | 4 +- ...aitingValidationIntegrationEventHandler.cs | 4 +- ...tusChangedToPaidIntegrationEventHandler.cs | 4 +- src/Services/Catalog/Catalog.API/Program.cs | 20 +------- .../CatalogScenarioBase.cs | 51 +++++++++++-------- ...ePeriodConfirmedIntegrationEventHandler.cs | 2 +- ...derPaymentFailedIntegrationEventHandler.cs | 2 +- ...PaymentSucceededIntegrationEventHandler.cs | 2 +- ...erStockConfirmedIntegrationEventHandler.cs | 2 +- ...derStockRejectedIntegrationEventHandler.cs | 2 +- ...CheckoutAcceptedIntegrationEventHandler.cs | 2 +- ...aitingValidationIntegrationEventHandler.cs | 2 +- ...angedToCancelledIntegrationEventHandler.cs | 2 +- ...tusChangedToPaidIntegrationEventHandler.cs | 2 +- ...ChangedToShippedIntegrationEventHandler.cs | 2 +- ...ToStockConfirmedIntegrationEventHandler.cs | 2 +- ...angedToSubmittedIntegrationEventHandler.cs | 2 +- ...ToStockConfirmedIntegrationEventHandler.cs | 2 +- 21 files changed, 58 insertions(+), 61 deletions(-) diff --git a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs index c09ba2346..560c43d2a 100644 --- a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs +++ b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs @@ -17,7 +17,7 @@ public class ProductPriceChangedIntegrationEventHandler : IIntegrationEventHandl { using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}")) { - _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, @event); + _logger.LogInformation("----- Handling integration event: {IntegrationEventId} - ({@IntegrationEvent})", @event.Id, @event); var userIds = _repository.GetUsers(); diff --git a/src/Services/Basket/Basket.FunctionalTests/Base/BasketScenarioBase.cs b/src/Services/Basket/Basket.FunctionalTests/Base/BasketScenarioBase.cs index ddf920e14..8f56d94c3 100644 --- a/src/Services/Basket/Basket.FunctionalTests/Base/BasketScenarioBase.cs +++ b/src/Services/Basket/Basket.FunctionalTests/Base/BasketScenarioBase.cs @@ -9,7 +9,7 @@ public class BasketScenarioBase public TestServer CreateServer() { - var factory = new BasketApplicaton(); + var factory = new BasketApplication(); return factory.Server; } @@ -27,7 +27,7 @@ public class BasketScenarioBase public static string CheckoutOrder = $"{ApiUrlBase}/checkout"; } - private class BasketApplicaton : WebApplicationFactory + private class BasketApplication : WebApplicationFactory { protected override IHost CreateHost(IHostBuilder builder) { diff --git a/src/Services/Catalog/Catalog.API/Catalog.API.csproj b/src/Services/Catalog/Catalog.API/Catalog.API.csproj index 9c7d98d03..0d834939a 100644 --- a/src/Services/Catalog/Catalog.API/Catalog.API.csproj +++ b/src/Services/Catalog/Catalog.API/Catalog.API.csproj @@ -37,6 +37,10 @@ + + + + diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs index 282bea5b3..15cbb7ff7 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs @@ -26,7 +26,7 @@ public class CatalogIntegrationEventService : ICatalogIntegrationEventService, I { try { - _logger.LogInformation("----- Publishing integration event: {IntegrationEventId_published} from {AppName} - ({@IntegrationEvent})", evt.Id, Program.AppName, evt); + _logger.LogInformation("----- Publishing integration event: {IntegrationEventId_published} - ({@IntegrationEvent})", evt.Id, evt); await _eventLogService.MarkEventAsInProgressAsync(evt.Id); _eventBus.Publish(evt); @@ -34,7 +34,7 @@ public class CatalogIntegrationEventService : ICatalogIntegrationEventService, I } catch (Exception ex) { - _logger.LogError(ex, "ERROR Publishing integration event: {IntegrationEventId} from {AppName} - ({@IntegrationEvent})", evt.Id, Program.AppName, evt); + _logger.LogError(ex, "ERROR Publishing integration event: {IntegrationEventId} - ({@IntegrationEvent})", evt.Id, evt); await _eventLogService.MarkEventAsFailedAsync(evt.Id); } } diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs index 01fb5dfa9..81c9ff909 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs @@ -19,9 +19,9 @@ public class OrderStatusChangedToAwaitingValidationIntegrationEventHandler : public async Task Handle(OrderStatusChangedToAwaitingValidationIntegrationEvent @event) { - using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}")) + using (LogContext.PushProperty("IntegrationEventContext", @event.Id)) { - _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); + _logger.LogInformation("----- Handling integration event: {IntegrationEventId} - ({@IntegrationEvent})", @event.Id, @event); var confirmedOrderStockItems = new List(); diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs index 8882e78a6..c0f87139a 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs @@ -16,9 +16,9 @@ public class OrderStatusChangedToPaidIntegrationEventHandler : public async Task Handle(OrderStatusChangedToPaidIntegrationEvent @event) { - using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}")) + using (LogContext.PushProperty("IntegrationEventContext", @event.Id)) { - _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); + _logger.LogInformation("----- Handling integration event: {IntegrationEventId} - ({@IntegrationEvent})", @event.Id, @event); //we're not blocking stock/inventory foreach (var orderStockItem in @event.OrderStockItems) diff --git a/src/Services/Catalog/Catalog.API/Program.cs b/src/Services/Catalog/Catalog.API/Program.cs index 01287d8be..c39d369c8 100644 --- a/src/Services/Catalog/Catalog.API/Program.cs +++ b/src/Services/Catalog/Catalog.API/Program.cs @@ -41,11 +41,8 @@ var eventBus = app.Services.GetRequiredService(); eventBus.Subscribe(); eventBus.Subscribe(); -try +using (var scope = app.Services.CreateScope()) { - app.Logger.LogInformation("Configuring web host ({ApplicationContext})...", AppName); - - using var scope = app.Services.CreateScope(); var context = scope.ServiceProvider.GetRequiredService(); var settings = app.Services.GetService>(); var logger = app.Services.GetService>(); @@ -54,19 +51,6 @@ try await new CatalogContextSeed().SeedAsync(context, app.Environment, settings, logger); var integEventContext = scope.ServiceProvider.GetRequiredService(); await integEventContext.Database.MigrateAsync(); - app.Logger.LogInformation("Starting web host ({ApplicationName})...", AppName); - await app.RunAsync(); - - return 0; -} -catch (Exception ex) -{ - app.Logger.LogCritical(ex, "Program terminated unexpectedly ({ApplicationContext})!", AppName); - return 1; } -public partial class Program -{ - public static string Namespace = typeof(Program).Assembly.GetName().Name; - public static string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1); -} +await app.RunAsync(); diff --git a/src/Services/Catalog/Catalog.FunctionalTests/CatalogScenarioBase.cs b/src/Services/Catalog/Catalog.FunctionalTests/CatalogScenarioBase.cs index 224896537..ee7bb21a8 100644 --- a/src/Services/Catalog/Catalog.FunctionalTests/CatalogScenarioBase.cs +++ b/src/Services/Catalog/Catalog.FunctionalTests/CatalogScenarioBase.cs @@ -2,36 +2,45 @@ namespace Catalog.FunctionalTests; -public class CatalogScenariosBase : WebApplicationFactory +public class CatalogScenariosBase { public TestServer CreateServer() { - Services - .MigrateDbContext((context, services) => - { - var env = services.GetService(); - var settings = services.GetService>(); - var logger = services.GetService>(); - - new CatalogContextSeed() - .SeedAsync(context, env, settings, logger) - .Wait(); - }) - .MigrateDbContext((_, __) => { }); - - return Server; + var factory = new CatalogApplication(); + return factory.CreateServer(); } - protected override IHost CreateHost(IHostBuilder builder) + private class CatalogApplication : WebApplicationFactory { - builder.ConfigureAppConfiguration(c => + public TestServer CreateServer() + { + Services + .MigrateDbContext((context, services) => + { + var env = services.GetService(); + var settings = services.GetService>(); + var logger = services.GetService>(); + + new CatalogContextSeed() + .SeedAsync(context, env, settings, logger) + .Wait(); + }) + .MigrateDbContext((_, __) => { }); + + return Server; + } + + protected override IHost CreateHost(IHostBuilder builder) { - var directory = Path.GetDirectoryName(typeof(CatalogScenariosBase).Assembly.Location)!; + builder.ConfigureAppConfiguration(c => + { + var directory = Path.GetDirectoryName(typeof(CatalogScenariosBase).Assembly.Location)!; - c.AddJsonFile(Path.Combine(directory, "appsettings.json"), optional: false); - }); + c.AddJsonFile(Path.Combine(directory, "appsettings.json"), optional: false); + }); - return base.CreateHost(builder); + return base.CreateHost(builder); + } } public static class Get diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/GracePeriodConfirmedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/GracePeriodConfirmedIntegrationEventHandler.cs index 55a8a39b9..a6056041c 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/GracePeriodConfirmedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/GracePeriodConfirmedIntegrationEventHandler.cs @@ -23,7 +23,7 @@ public class GracePeriodConfirmedIntegrationEventHandler : IIntegrationEventHand /// public async Task Handle(GracePeriodConfirmedIntegrationEvent @event) { - using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}")) + using (LogContext.PushProperty("IntegrationEventContext", @event.Id)) { _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentFailedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentFailedIntegrationEventHandler.cs index 4170ac18f..8725408b4 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentFailedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentFailedIntegrationEventHandler.cs @@ -16,7 +16,7 @@ public class OrderPaymentFailedIntegrationEventHandler : public async Task Handle(OrderPaymentFailedIntegrationEvent @event) { - using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}")) + using (LogContext.PushProperty("IntegrationEventContext", @event.Id)) { _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentSucceededIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentSucceededIntegrationEventHandler.cs index af9817696..c0a69268e 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentSucceededIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentSucceededIntegrationEventHandler.cs @@ -16,7 +16,7 @@ public class OrderPaymentSucceededIntegrationEventHandler : public async Task Handle(OrderPaymentSucceededIntegrationEvent @event) { - using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}")) + using (LogContext.PushProperty("IntegrationEventContext", @event.Id)) { _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs index e5ed967a9..e99b49f5e 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs @@ -16,7 +16,7 @@ public class OrderStockConfirmedIntegrationEventHandler : public async Task Handle(OrderStockConfirmedIntegrationEvent @event) { - using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}")) + using (LogContext.PushProperty("IntegrationEventContext", @event.Id)) { _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs index 4fa61b9b5..2468e25a6 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs @@ -14,7 +14,7 @@ public class OrderStockRejectedIntegrationEventHandler : IIntegrationEventHandle public async Task Handle(OrderStockRejectedIntegrationEvent @event) { - using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}")) + using (LogContext.PushProperty("IntegrationEventContext", @event.Id)) { _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs index a5a15c06c..f1c3cc964 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs @@ -24,7 +24,7 @@ public class UserCheckoutAcceptedIntegrationEventHandler : IIntegrationEventHand /// public async Task Handle(UserCheckoutAcceptedIntegrationEvent @event) { - using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}")) + using (LogContext.PushProperty("IntegrationEventContext", @event.Id)) { _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs index 341b781ab..f42889d98 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs @@ -16,7 +16,7 @@ public class OrderStatusChangedToAwaitingValidationIntegrationEventHandler : IIn public async Task Handle(OrderStatusChangedToAwaitingValidationIntegrationEvent @event) { - using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}")) + using (LogContext.PushProperty("IntegrationEventContext", @event.Id)) { _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToCancelledIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToCancelledIntegrationEventHandler.cs index aba5091b9..fa2b75ebc 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToCancelledIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToCancelledIntegrationEventHandler.cs @@ -16,7 +16,7 @@ public class OrderStatusChangedToCancelledIntegrationEventHandler : IIntegration public async Task Handle(OrderStatusChangedToCancelledIntegrationEvent @event) { - using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}")) + using (LogContext.PushProperty("IntegrationEventContext", @event.Id)) { _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs index 03fc04356..bc8ea3d4b 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs @@ -16,7 +16,7 @@ public class OrderStatusChangedToPaidIntegrationEventHandler : IIntegrationEvent public async Task Handle(OrderStatusChangedToPaidIntegrationEvent @event) { - using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}")) + using (LogContext.PushProperty("IntegrationEventContext", @event.Id)) { _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToShippedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToShippedIntegrationEventHandler.cs index 663f7ae3a..f6356268d 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToShippedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToShippedIntegrationEventHandler.cs @@ -16,7 +16,7 @@ public class OrderStatusChangedToShippedIntegrationEventHandler : IIntegrationEv public async Task Handle(OrderStatusChangedToShippedIntegrationEvent @event) { - using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}")) + using (LogContext.PushProperty("IntegrationEventContext", @event.Id)) { _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs index aa662065d..3289dff9a 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs @@ -17,7 +17,7 @@ public class OrderStatusChangedToStockConfirmedIntegrationEventHandler : public async Task Handle(OrderStatusChangedToStockConfirmedIntegrationEvent @event) { - using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}")) + using (LogContext.PushProperty("IntegrationEventContext", @event.Id)) { _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToSubmittedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToSubmittedIntegrationEventHandler.cs index 0f8042013..144a5e7c6 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToSubmittedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToSubmittedIntegrationEventHandler.cs @@ -17,7 +17,7 @@ public class OrderStatusChangedToSubmittedIntegrationEventHandler : public async Task Handle(OrderStatusChangedToSubmittedIntegrationEvent @event) { - using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}")) + using (LogContext.PushProperty("IntegrationEventContext", @event.Id)) { _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); diff --git a/src/Services/Payment/Payment.API/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs b/src/Services/Payment/Payment.API/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs index 8c8fac9d0..0712f8908 100644 --- a/src/Services/Payment/Payment.API/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs +++ b/src/Services/Payment/Payment.API/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs @@ -21,7 +21,7 @@ public class OrderStatusChangedToStockConfirmedIntegrationEventHandler : public async Task Handle(OrderStatusChangedToStockConfirmedIntegrationEvent @event) { - using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}")) + using (LogContext.PushProperty("IntegrationEventContext", @event.Id)) { _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);