Standarize ApplicationContext logging property
This commit is contained in:
parent
38a86f19c4
commit
b6b0744c74
@ -23,17 +23,17 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.Information("Configuring web host ({Application})...", AppName);
|
Log.Information("Configuring web host ({ApplicationContext})...", AppName);
|
||||||
var host = BuildWebHost(configuration, args);
|
var host = BuildWebHost(configuration, args);
|
||||||
|
|
||||||
Log.Information("Starting web host ({Application})...", AppName);
|
Log.Information("Starting web host ({ApplicationContext})...", AppName);
|
||||||
host.Run();
|
host.Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", AppName);
|
Log.Fatal(ex, "Program terminated unexpectedly ({ApplicationContext})!", AppName);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -25,10 +25,10 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.Information("Configuring web host ({Application})...", AppName);
|
Log.Information("Configuring web host ({ApplicationContext})...", AppName);
|
||||||
var host = BuildWebHost(configuration, args);
|
var host = BuildWebHost(configuration, args);
|
||||||
|
|
||||||
Log.Information("Applying migrations ({Application})...", AppName);
|
Log.Information("Applying migrations ({ApplicationContext})...", AppName);
|
||||||
host.MigrateDbContext<CatalogContext>((context, services) =>
|
host.MigrateDbContext<CatalogContext>((context, services) =>
|
||||||
{
|
{
|
||||||
var env = services.GetService<IHostingEnvironment>();
|
var env = services.GetService<IHostingEnvironment>();
|
||||||
@ -41,14 +41,14 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API
|
|||||||
})
|
})
|
||||||
.MigrateDbContext<IntegrationEventLogContext>((_, __) => { });
|
.MigrateDbContext<IntegrationEventLogContext>((_, __) => { });
|
||||||
|
|
||||||
Log.Information("Starting web host ({Application})...", AppName);
|
Log.Information("Starting web host ({ApplicationContext})...", AppName);
|
||||||
host.Run();
|
host.Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", AppName);
|
Log.Fatal(ex, "Program terminated unexpectedly ({ApplicationContext})!", AppName);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -25,10 +25,10 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.Information("Configuring web host ({Application})...", AppName);
|
Log.Information("Configuring web host ({ApplicationContext})...", AppName);
|
||||||
var host = BuildWebHost(configuration, args);
|
var host = BuildWebHost(configuration, args);
|
||||||
|
|
||||||
Log.Information("Applying migrations ({Application})...", AppName);
|
Log.Information("Applying migrations ({ApplicationContext})...", AppName);
|
||||||
host.MigrateDbContext<PersistedGrantDbContext>((_, __) => { })
|
host.MigrateDbContext<PersistedGrantDbContext>((_, __) => { })
|
||||||
.MigrateDbContext<ApplicationDbContext>((context, services) =>
|
.MigrateDbContext<ApplicationDbContext>((context, services) =>
|
||||||
{
|
{
|
||||||
@ -47,14 +47,14 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
|
|||||||
.Wait();
|
.Wait();
|
||||||
});
|
});
|
||||||
|
|
||||||
Log.Information("Starting web host ({Application})...", AppName);
|
Log.Information("Starting web host ({ApplicationContext})...", AppName);
|
||||||
host.Run();
|
host.Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", AppName);
|
Log.Fatal(ex, "Program terminated unexpectedly ({ApplicationContext})!", AppName);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -22,17 +22,17 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.Information("Configuring web host ({Application})...", AppName);
|
Log.Information("Configuring web host ({ApplicationContext})...", AppName);
|
||||||
var host = BuildWebHost(configuration, args);
|
var host = BuildWebHost(configuration, args);
|
||||||
|
|
||||||
Log.Information("Starting web host ({Application})...", AppName);
|
Log.Information("Starting web host ({ApplicationContext})...", AppName);
|
||||||
host.Run();
|
host.Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", AppName);
|
Log.Fatal(ex, "Program terminated unexpectedly ({ApplicationContext})!", AppName);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -23,10 +23,10 @@
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.Information("Configuring web host ({Application})...", AppName);
|
Log.Information("Configuring web host ({ApplicationContext})...", AppName);
|
||||||
var host = BuildWebHost(configuration, args);
|
var host = BuildWebHost(configuration, args);
|
||||||
|
|
||||||
Log.Information("Applying migrations ({Application})...", AppName);
|
Log.Information("Applying migrations ({ApplicationContext})...", AppName);
|
||||||
host.MigrateDbContext<MarketingContext>((context, services) =>
|
host.MigrateDbContext<MarketingContext>((context, services) =>
|
||||||
{
|
{
|
||||||
var logger = services.GetService<ILogger<MarketingContextSeed>>();
|
var logger = services.GetService<ILogger<MarketingContextSeed>>();
|
||||||
@ -36,14 +36,14 @@
|
|||||||
.Wait();
|
.Wait();
|
||||||
});
|
});
|
||||||
|
|
||||||
Log.Information("Starting web host ({Application})...", AppName);
|
Log.Information("Starting web host ({ApplicationContext})...", AppName);
|
||||||
host.Run();
|
host.Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", AppName);
|
Log.Fatal(ex, "Program terminated unexpectedly ({ApplicationContext})!", AppName);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -26,10 +26,10 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.Information("Configuring web host ({Application})...", AppName);
|
Log.Information("Configuring web host ({ApplicationContext})...", AppName);
|
||||||
var host = BuildWebHost(configuration, args);
|
var host = BuildWebHost(configuration, args);
|
||||||
|
|
||||||
Log.Information("Applying migrations ({Application})...", AppName);
|
Log.Information("Applying migrations ({ApplicationContext})...", AppName);
|
||||||
host.MigrateDbContext<OrderingContext>((context, services) =>
|
host.MigrateDbContext<OrderingContext>((context, services) =>
|
||||||
{
|
{
|
||||||
var env = services.GetService<IHostingEnvironment>();
|
var env = services.GetService<IHostingEnvironment>();
|
||||||
@ -42,14 +42,14 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API
|
|||||||
})
|
})
|
||||||
.MigrateDbContext<IntegrationEventLogContext>((_, __) => { });
|
.MigrateDbContext<IntegrationEventLogContext>((_, __) => { });
|
||||||
|
|
||||||
Log.Information("Starting web host ({Application})...", AppName);
|
Log.Information("Starting web host ({ApplicationContext})...", AppName);
|
||||||
host.Run();
|
host.Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", AppName);
|
Log.Fatal(ex, "Program terminated unexpectedly ({ApplicationContext})!", AppName);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -21,17 +21,17 @@ namespace Ordering.BackgroundTasks
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.Information("Configuring web host ({Application})...", AppName);
|
Log.Information("Configuring web host ({ApplicationContext})...", AppName);
|
||||||
var host = BuildWebHost(configuration, args);
|
var host = BuildWebHost(configuration, args);
|
||||||
|
|
||||||
Log.Information("Starting web host ({Application})...", AppName);
|
Log.Information("Starting web host ({ApplicationContext})...", AppName);
|
||||||
host.Run();
|
host.Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", AppName);
|
Log.Fatal(ex, "Program terminated unexpectedly ({ApplicationContext})!", AppName);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -24,17 +24,17 @@ namespace Ordering.SignalrHub
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.Information("Configuring web host ({Application})...", AppName);
|
Log.Information("Configuring web host ({ApplicationContext})...", AppName);
|
||||||
var host = BuildWebHost(configuration, args);
|
var host = BuildWebHost(configuration, args);
|
||||||
|
|
||||||
Log.Information("Starting web host ({Application})...", AppName);
|
Log.Information("Starting web host ({ApplicationContext})...", AppName);
|
||||||
host.Run();
|
host.Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", AppName);
|
Log.Fatal(ex, "Program terminated unexpectedly ({ApplicationContext})!", AppName);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -22,17 +22,17 @@ namespace Payment.API
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.Information("Configuring web host ({Application})...", AppName);
|
Log.Information("Configuring web host ({ApplicationContext})...", AppName);
|
||||||
var host = BuildWebHost(configuration, args);
|
var host = BuildWebHost(configuration, args);
|
||||||
|
|
||||||
Log.Information("Starting web host ({Application})...", AppName);
|
Log.Information("Starting web host ({ApplicationContext})...", AppName);
|
||||||
host.Run();
|
host.Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", AppName);
|
Log.Fatal(ex, "Program terminated unexpectedly ({ApplicationContext})!", AppName);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -21,17 +21,17 @@ namespace Microsoft.eShopOnContainers.WebMVC
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.Information("Configuring web host ({Application})...", AppName);
|
Log.Information("Configuring web host ({ApplicationContext})...", AppName);
|
||||||
var host = BuildWebHost(configuration, args);
|
var host = BuildWebHost(configuration, args);
|
||||||
|
|
||||||
Log.Information("Starting web host ({Application})...", AppName);
|
Log.Information("Starting web host ({ApplicationContext})...", AppName);
|
||||||
host.Run();
|
host.Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", AppName);
|
Log.Fatal(ex, "Program terminated unexpectedly ({ApplicationContext})!", AppName);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -21,17 +21,17 @@ namespace WebStatus
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.Information("Configuring web host ({Application})...", AppName);
|
Log.Information("Configuring web host ({ApplicationContext})...", AppName);
|
||||||
var host = BuildWebHost(configuration, args);
|
var host = BuildWebHost(configuration, args);
|
||||||
|
|
||||||
Log.Information("Starting web host ({Application})...", AppName);
|
Log.Information("Starting web host ({ApplicationContext})...", AppName);
|
||||||
host.Run();
|
host.Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", AppName);
|
Log.Fatal(ex, "Program terminated unexpectedly ({ApplicationContext})!", AppName);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
Loading…
x
Reference in New Issue
Block a user