General refactoring for documentation

This commit is contained in:
Miguel Veloso 2019-02-26 21:55:04 +00:00
parent 7dbab01b44
commit 38a86f19c4
34 changed files with 78 additions and 78 deletions

View File

@ -80,13 +80,13 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers
// order creation process // order creation process
try try
{ {
_logger.LogInformation("----- Publishing integration event: {IntegrationEventId} from {ShortAppName} - ({@IntegrationEvent})", eventMessage.Id, Program.ShortAppName, eventMessage); _logger.LogInformation("----- Publishing integration event: {IntegrationEventId} from {AppName} - ({@IntegrationEvent})", eventMessage.Id, Program.AppName, eventMessage);
_eventBus.Publish(eventMessage); _eventBus.Publish(eventMessage);
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "ERROR Publishing integration event: {IntegrationEventId} from {ShortAppName}", eventMessage.Id, Program.ShortAppName); _logger.LogError(ex, "ERROR Publishing integration event: {IntegrationEventId} from {AppName}", eventMessage.Id, Program.AppName);
throw; throw;
} }

View File

@ -24,9 +24,9 @@ namespace Basket.API.IntegrationEvents.EventHandling
public async Task Handle(OrderStartedIntegrationEvent @event) public async Task Handle(OrderStartedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
await _repository.DeleteBasketAsync(@event.UserId.ToString()); await _repository.DeleteBasketAsync(@event.UserId.ToString());
} }

View File

@ -24,9 +24,9 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Even
public async Task Handle(ProductPriceChangedIntegrationEvent @event) public async Task Handle(ProductPriceChangedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
var userIds = _repository.GetUsers(); var userIds = _repository.GetUsers();

View File

@ -12,8 +12,8 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
{ {
public class Program public class Program
{ {
public static readonly string AppName = typeof(Program).Namespace; public static readonly string Namespace = typeof(Program).Namespace;
public static readonly string ShortAppName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); public static readonly string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1);
public static int Main(string[] args) public static int Main(string[] args)
{ {
@ -60,7 +60,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
return new LoggerConfiguration() return new LoggerConfiguration()
.MinimumLevel.Verbose() .MinimumLevel.Verbose()
.Enrich.WithProperty("Application", AppName) .Enrich.WithProperty("ApplicationContext", AppName)
.Enrich.FromLogContext() .Enrich.FromLogContext()
.WriteTo.Console() .WriteTo.Console()
.WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl) .WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl)

View File

@ -39,7 +39,7 @@ namespace Catalog.API.IntegrationEvents
{ {
try try
{ {
_logger.LogInformation("----- Publishing integration event: {IntegrationEventId_published} from {ShortAppName} - ({@IntegrationEvent})", evt.Id, Program.ShortAppName, evt); _logger.LogInformation("----- Publishing integration event: {IntegrationEventId_published} from {AppName} - ({@IntegrationEvent})", evt.Id, Program.AppName, evt);
await _eventLogService.MarkEventAsInProgressAsync(evt.Id); await _eventLogService.MarkEventAsInProgressAsync(evt.Id);
_eventBus.Publish(evt); _eventBus.Publish(evt);
@ -47,7 +47,7 @@ namespace Catalog.API.IntegrationEvents
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "ERROR Publishing integration event: {IntegrationEventId} from {ShortAppName} - ({@IntegrationEvent})", evt.Id, Program.ShortAppName, evt); _logger.LogError(ex, "ERROR Publishing integration event: {IntegrationEventId} from {AppName} - ({@IntegrationEvent})", evt.Id, Program.AppName, evt);
await _eventLogService.MarkEventAsFailedAsync(evt.Id); await _eventLogService.MarkEventAsFailedAsync(evt.Id);
} }
} }

View File

@ -30,9 +30,9 @@
public async Task Handle(OrderStatusChangedToAwaitingValidationIntegrationEvent @event) public async Task Handle(OrderStatusChangedToAwaitingValidationIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
var confirmedOrderStockItems = new List<ConfirmedOrderStockItem>(); var confirmedOrderStockItems = new List<ConfirmedOrderStockItem>();

View File

@ -23,9 +23,9 @@
public async Task Handle(OrderStatusChangedToPaidIntegrationEvent @event) public async Task Handle(OrderStatusChangedToPaidIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
//we're not blocking stock/inventory //we're not blocking stock/inventory
foreach (var orderStockItem in @event.OrderStockItems) foreach (var orderStockItem in @event.OrderStockItems)

View File

@ -14,8 +14,8 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API
{ {
public class Program public class Program
{ {
public static readonly string AppName = typeof(Program).Namespace; public static readonly string Namespace = typeof(Program).Namespace;
public static readonly string ShortAppName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); public static readonly string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1);
public static int Main(string[] args) public static int Main(string[] args)
{ {
@ -74,7 +74,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API
return new LoggerConfiguration() return new LoggerConfiguration()
.MinimumLevel.Verbose() .MinimumLevel.Verbose()
.Enrich.WithProperty("Application", AppName) .Enrich.WithProperty("ApplicationContext", AppName)
.Enrich.FromLogContext() .Enrich.FromLogContext()
.WriteTo.Console() .WriteTo.Console()
.WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl) .WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl)

View File

@ -14,8 +14,8 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
{ {
public class Program public class Program
{ {
public static readonly string AppName = typeof(Program).Namespace; public static readonly string Namespace = typeof(Program).Namespace;
public static readonly string ShortAppName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); public static readonly string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1);
public static int Main(string[] args) public static int Main(string[] args)
{ {
@ -80,7 +80,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
return new LoggerConfiguration() return new LoggerConfiguration()
.MinimumLevel.Verbose() .MinimumLevel.Verbose()
.Enrich.WithProperty("Application", AppName) .Enrich.WithProperty("ApplicationContext", AppName)
.Enrich.FromLogContext() .Enrich.FromLogContext()
.WriteTo.Console() .WriteTo.Console()
.WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl) .WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl)

View File

@ -73,7 +73,7 @@
var newUserLocations = MapUserLocationDetails(newLocations); var newUserLocations = MapUserLocationDetails(newLocations);
var @event = new UserLocationUpdatedIntegrationEvent(userId, newUserLocations); var @event = new UserLocationUpdatedIntegrationEvent(userId, newUserLocations);
_logger.LogInformation("----- Publishing integration event: {IntegrationEventId} from {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Publishing integration event: {IntegrationEventId} from {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
_eventBus.Publish(@event); _eventBus.Publish(@event);
} }

View File

@ -11,8 +11,8 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API
{ {
public class Program public class Program
{ {
public static readonly string AppName = typeof(Program).Namespace; public static readonly string Namespace = typeof(Program).Namespace;
public static readonly string ShortAppName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); public static readonly string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1);
public static int Main(string[] args) public static int Main(string[] args)
{ {
@ -57,7 +57,7 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API
return new LoggerConfiguration() return new LoggerConfiguration()
.MinimumLevel.Verbose() .MinimumLevel.Verbose()
.Enrich.WithProperty("Application", AppName) .Enrich.WithProperty("ApplicationContext", AppName)
.Enrich.FromLogContext() .Enrich.FromLogContext()
.WriteTo.Console() .WriteTo.Console()
.WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl) .WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl)

View File

@ -26,9 +26,9 @@
public async Task Handle(UserLocationUpdatedIntegrationEvent @event) public async Task Handle(UserLocationUpdatedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
var userMarketingData = await _marketingDataRepository.GetAsync(@event.UserId); var userMarketingData = await _marketingDataRepository.GetAsync(@event.UserId);
userMarketingData = userMarketingData ?? userMarketingData = userMarketingData ??

View File

@ -12,8 +12,8 @@
public class Program public class Program
{ {
public static readonly string AppName = typeof(Program).Namespace; public static readonly string Namespace = typeof(Program).Namespace;
public static readonly string ShortAppName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); public static readonly string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1);
public static int Main(string[] args) public static int Main(string[] args)
{ {
@ -69,7 +69,7 @@
return new LoggerConfiguration() return new LoggerConfiguration()
.MinimumLevel.Verbose() .MinimumLevel.Verbose()
.Enrich.WithProperty("Application", AppName) .Enrich.WithProperty("ApplicationContext", AppName)
.Enrich.FromLogContext() .Enrich.FromLogContext()
.WriteTo.Console() .WriteTo.Console()
.WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl) .WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl)

View File

@ -34,9 +34,9 @@ namespace Ordering.API.Application.IntegrationEvents.EventHandling
/// <returns></returns> /// <returns></returns>
public async Task Handle(GracePeriodConfirmedIntegrationEvent @event) public async Task Handle(GracePeriodConfirmedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
var command = new SetAwaitingValidationOrderStatusCommand(@event.OrderId); var command = new SetAwaitingValidationOrderStatusCommand(@event.OrderId);

View File

@ -28,9 +28,9 @@
public async Task Handle(OrderPaymentFailedIntegrationEvent @event) public async Task Handle(OrderPaymentFailedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
var command = new CancelOrderCommand(@event.OrderId); var command = new CancelOrderCommand(@event.OrderId);

View File

@ -28,9 +28,9 @@
public async Task Handle(OrderPaymentSuccededIntegrationEvent @event) public async Task Handle(OrderPaymentSuccededIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
var command = new SetPaidOrderStatusCommand(@event.OrderId); var command = new SetPaidOrderStatusCommand(@event.OrderId);

View File

@ -28,9 +28,9 @@
public async Task Handle(OrderStockConfirmedIntegrationEvent @event) public async Task Handle(OrderStockConfirmedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
var command = new SetStockConfirmedOrderStatusCommand(@event.OrderId); var command = new SetStockConfirmedOrderStatusCommand(@event.OrderId);

View File

@ -27,9 +27,9 @@
public async Task Handle(OrderStockRejectedIntegrationEvent @event) public async Task Handle(OrderStockRejectedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
var orderStockRejectedItems = @event.OrderStockItems var orderStockRejectedItems = @event.OrderStockItems
.FindAll(c => !c.HasStock) .FindAll(c => !c.HasStock)

View File

@ -35,9 +35,9 @@ namespace Ordering.API.Application.IntegrationEvents.EventHandling
/// <returns></returns> /// <returns></returns>
public async Task Handle(UserCheckoutAcceptedIntegrationEvent @event) public async Task Handle(UserCheckoutAcceptedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
var result = false; var result = false;

View File

@ -45,7 +45,7 @@ namespace Ordering.API.Application.IntegrationEvents
foreach (var logEvt in pendindLogEvents) foreach (var logEvt in pendindLogEvents)
{ {
_logger.LogInformation("----- Publishing integration event: {IntegrationEventId} from {ShortAppName} - ({@IntegrationEvent})", logEvt.EventId, Program.ShortAppName, logEvt.IntegrationEvent); _logger.LogInformation("----- Publishing integration event: {IntegrationEventId} from {AppName} - ({@IntegrationEvent})", logEvt.EventId, Program.AppName, logEvt.IntegrationEvent);
try try
{ {
@ -55,7 +55,7 @@ namespace Ordering.API.Application.IntegrationEvents
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "ERROR publishing integration event: {IntegrationEventId} from {ShortAppName}", logEvt.EventId, Program.ShortAppName); _logger.LogError(ex, "ERROR publishing integration event: {IntegrationEventId} from {AppName}", logEvt.EventId, Program.AppName);
await _eventLogService.MarkEventAsFailedAsync(logEvt.EventId); await _eventLogService.MarkEventAsFailedAsync(logEvt.EventId);
} }

View File

@ -15,8 +15,8 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API
{ {
public class Program public class Program
{ {
public static readonly string AppName = typeof(Program).Namespace; public static readonly string Namespace = typeof(Program).Namespace;
public static readonly string ShortAppName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); public static readonly string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1);
public static int Main(string[] args) public static int Main(string[] args)
{ {
@ -74,7 +74,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API
return new LoggerConfiguration() return new LoggerConfiguration()
.MinimumLevel.Verbose() .MinimumLevel.Verbose()
.Enrich.WithProperty("Application", AppName) .Enrich.WithProperty("ApplicationContext", AppName)
.Enrich.FromLogContext() .Enrich.FromLogContext()
.WriteTo.Console() .WriteTo.Console()
.WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl) .WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl)

View File

@ -10,8 +10,8 @@ namespace Ordering.BackgroundTasks
{ {
public class Program public class Program
{ {
public static readonly string AppName = typeof(Program).Namespace; public static readonly string Namespace = typeof(Program).Namespace;
public static readonly string ShortAppName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); public static readonly string AppName = Namespace;
public static int Main(string[] args) public static int Main(string[] args)
{ {
@ -54,7 +54,7 @@ namespace Ordering.BackgroundTasks
return new LoggerConfiguration() return new LoggerConfiguration()
.MinimumLevel.Verbose() .MinimumLevel.Verbose()
.Enrich.WithProperty("Application", AppName) .Enrich.WithProperty("ApplicationContext", AppName)
.Enrich.FromLogContext() .Enrich.FromLogContext()
.WriteTo.Console() .WriteTo.Console()
.WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl) .WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl)

View File

@ -61,7 +61,7 @@ namespace Ordering.BackgroundTasks.Tasks
{ {
var confirmGracePeriodEvent = new GracePeriodConfirmedIntegrationEvent(orderId); var confirmGracePeriodEvent = new GracePeriodConfirmedIntegrationEvent(orderId);
_logger.LogInformation("----- Publishing integration event: {IntegrationEventId} from {ShortAppName} - ({@IntegrationEvent})", confirmGracePeriodEvent.Id, Program.ShortAppName, confirmGracePeriodEvent); _logger.LogInformation("----- Publishing integration event: {IntegrationEventId} from {AppName} - ({@IntegrationEvent})", confirmGracePeriodEvent.Id, Program.AppName, confirmGracePeriodEvent);
_eventBus.Publish(confirmGracePeriodEvent); _eventBus.Publish(confirmGracePeriodEvent);
} }

View File

@ -26,9 +26,9 @@ namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
public async Task Handle(OrderStatusChangedToCancelledIntegrationEvent @event) public async Task Handle(OrderStatusChangedToCancelledIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
await _hubContext.Clients await _hubContext.Clients
.Group(@event.BuyerName) .Group(@event.BuyerName)

View File

@ -24,9 +24,9 @@ namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
public async Task Handle(OrderStatusChangedToPaidIntegrationEvent @event) public async Task Handle(OrderStatusChangedToPaidIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
await _hubContext.Clients await _hubContext.Clients
.Group(@event.BuyerName) .Group(@event.BuyerName)

View File

@ -26,9 +26,9 @@ namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
public async Task Handle(OrderStatusChangedToShippedIntegrationEvent @event) public async Task Handle(OrderStatusChangedToShippedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
await _hubContext.Clients await _hubContext.Clients
.Group(@event.BuyerName) .Group(@event.BuyerName)

View File

@ -27,9 +27,9 @@ namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
public async Task Handle(OrderStatusChangedToStockConfirmedIntegrationEvent @event) public async Task Handle(OrderStatusChangedToStockConfirmedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
await _hubContext.Clients await _hubContext.Clients
.Group(@event.BuyerName) .Group(@event.BuyerName)

View File

@ -27,9 +27,9 @@ namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
public async Task Handle(OrderStatusChangedToSubmittedIntegrationEvent @event) public async Task Handle(OrderStatusChangedToSubmittedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
await _hubContext.Clients await _hubContext.Clients
.Group(@event.BuyerName) .Group(@event.BuyerName)

View File

@ -25,9 +25,9 @@ namespace Ordering.SignalrHub.IntegrationEvents
public async Task Handle(OrderStatusChangedToAwaitingValidationIntegrationEvent @event) public async Task Handle(OrderStatusChangedToAwaitingValidationIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
await _hubContext.Clients await _hubContext.Clients
.Group(@event.BuyerName) .Group(@event.BuyerName)

View File

@ -13,8 +13,8 @@ namespace Ordering.SignalrHub
{ {
public class Program public class Program
{ {
public static readonly string AppName = typeof(Program).Namespace; public static readonly string Namespace = typeof(Program).Namespace;
public static readonly string ShortAppName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); public static readonly string AppName = Namespace;
public static int Main(string[] args) public static int Main(string[] args)
{ {
@ -57,7 +57,7 @@ namespace Ordering.SignalrHub
return new LoggerConfiguration() return new LoggerConfiguration()
.MinimumLevel.Verbose() .MinimumLevel.Verbose()
.Enrich.WithProperty("Application", AppName) .Enrich.WithProperty("ApplicationContext", AppName)
.Enrich.FromLogContext() .Enrich.FromLogContext()
.WriteTo.Console() .WriteTo.Console()
.WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl) .WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl)

View File

@ -27,9 +27,9 @@
public async Task Handle(OrderStatusChangedToStockConfirmedIntegrationEvent @event) public async Task Handle(OrderStatusChangedToStockConfirmedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.ShortAppName}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {ShortAppName} - ({@IntegrationEvent})", @event.Id, Program.ShortAppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
IntegrationEvent orderPaymentIntegrationEvent; IntegrationEvent orderPaymentIntegrationEvent;
@ -48,7 +48,7 @@
orderPaymentIntegrationEvent = new OrderPaymentFailedIntegrationEvent(@event.OrderId); orderPaymentIntegrationEvent = new OrderPaymentFailedIntegrationEvent(@event.OrderId);
} }
_logger.LogInformation("----- Publishing integration event: {IntegrationEventId} from {ShortAppName} - ({@IntegrationEvent})", orderPaymentIntegrationEvent.Id, Program.ShortAppName, orderPaymentIntegrationEvent); _logger.LogInformation("----- Publishing integration event: {IntegrationEventId} from {AppName} - ({@IntegrationEvent})", orderPaymentIntegrationEvent.Id, Program.AppName, orderPaymentIntegrationEvent);
_eventBus.Publish(orderPaymentIntegrationEvent); _eventBus.Publish(orderPaymentIntegrationEvent);

View File

@ -11,8 +11,8 @@ namespace Payment.API
{ {
public class Program public class Program
{ {
public static readonly string AppName = typeof(Program).Namespace; public static readonly string Namespace = typeof(Program).Namespace;
public static readonly string ShortAppName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); public static readonly string AppName = Namespace;
public static int Main(string[] args) public static int Main(string[] args)
{ {
@ -57,7 +57,7 @@ namespace Payment.API
return new LoggerConfiguration() return new LoggerConfiguration()
.MinimumLevel.Verbose() .MinimumLevel.Verbose()
.Enrich.WithProperty("Application", AppName) .Enrich.WithProperty("ApplicationContext", AppName)
.Enrich.FromLogContext() .Enrich.FromLogContext()
.WriteTo.Console() .WriteTo.Console()
.WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl) .WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl)

View File

@ -10,8 +10,8 @@ namespace Microsoft.eShopOnContainers.WebMVC
{ {
public class Program public class Program
{ {
public static readonly string AppName = typeof(Program).Namespace; public static readonly string Namespace = typeof(Program).Namespace;
public static readonly string ShortAppName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); public static readonly string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1);
public static int Main(string[] args) public static int Main(string[] args)
{ {
@ -55,7 +55,7 @@ namespace Microsoft.eShopOnContainers.WebMVC
return new LoggerConfiguration() return new LoggerConfiguration()
.MinimumLevel.Verbose() .MinimumLevel.Verbose()
.Enrich.WithProperty("Application", AppName) .Enrich.WithProperty("ApplicationContext", AppName)
.Enrich.FromLogContext() .Enrich.FromLogContext()
.WriteTo.Console() .WriteTo.Console()
.WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl) .WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl)

View File

@ -10,8 +10,8 @@ namespace WebStatus
{ {
public class Program public class Program
{ {
public static readonly string AppName = typeof(Program).Namespace; public static readonly string Namespace = typeof(Program).Namespace;
public static readonly string ShortAppName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); public static readonly string AppName = Namespace;
public static int Main(string[] args) public static int Main(string[] args)
{ {
@ -56,7 +56,7 @@ namespace WebStatus
return new LoggerConfiguration() return new LoggerConfiguration()
.MinimumLevel.Verbose() .MinimumLevel.Verbose()
.Enrich.WithProperty("Application", AppName) .Enrich.WithProperty("ApplicationContext", AppName)
.Enrich.FromLogContext() .Enrich.FromLogContext()
.WriteTo.Console() .WriteTo.Console()
.WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl) .WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl)