@@ -14,7 +14,8 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API
1414{
1515 public class Program
1616 {
17- private static readonly string ApplicationName = typeof ( Program ) . Namespace ;
17+ public static readonly string AppName = typeof ( Program ) . Namespace ;
18+ public static readonly string ShortAppName = AppName . Substring ( AppName . LastIndexOf ( '.' , AppName . LastIndexOf ( '.' ) - 1 ) + 1 ) ;
1819
1920 public static int Main ( string [ ] args )
2021 {
@@ -24,30 +25,30 @@ public static int Main(string[] args)
2425
2526 try
2627 {
27- Log . Information ( "Configuring web host ({Application})..." , ApplicationName ) ;
28+ Log . Information ( "Configuring web host ({Application})..." , AppName ) ;
2829 var host = BuildWebHost ( configuration , args ) ;
2930
30- Log . Information ( "Applying migrations ({Application})..." , ApplicationName ) ;
31+ Log . Information ( "Applying migrations ({Application})..." , AppName ) ;
3132 host . MigrateDbContext < CatalogContext > ( ( context , services ) =>
3233 {
3334 var env = services . GetService < IHostingEnvironment > ( ) ;
3435 var settings = services . GetService < IOptions < CatalogSettings > > ( ) ;
3536 var logger = services . GetService < ILogger < CatalogContextSeed > > ( ) ;
3637
3738 new CatalogContextSeed ( )
38- . SeedAsync ( context , env , settings , logger )
39- . Wait ( ) ;
39+ . SeedAsync ( context , env , settings , logger )
40+ . Wait ( ) ;
4041 } )
4142 . MigrateDbContext < IntegrationEventLogContext > ( ( _ , __ ) => { } ) ;
4243
43- Log . Information ( "Starting web host ({Application})..." , ApplicationName ) ;
44+ Log . Information ( "Starting web host ({Application})..." , AppName ) ;
4445 host . Run ( ) ;
4546
4647 return 0 ;
4748 }
4849 catch ( Exception ex )
4950 {
50- Log . Fatal ( ex , "Program terminated unexpectedly ({Application})!" , ApplicationName ) ;
51+ Log . Fatal ( ex , "Program terminated unexpectedly ({Application})!" , AppName ) ;
5152 return 1 ;
5253 }
5354 finally
@@ -73,7 +74,7 @@ private static Serilog.ILogger CreateSerilogLogger(IConfiguration configuration)
7374
7475 return new LoggerConfiguration ( )
7576 . MinimumLevel . Verbose ( )
76- . Enrich . WithProperty ( "Application" , ApplicationName )
77+ . Enrich . WithProperty ( "Application" , AppName )
7778 . Enrich . FromLogContext ( )
7879 . WriteTo . Console ( )
7980 . WriteTo . Seq ( string . IsNullOrWhiteSpace ( seqServerUrl ) ? "http://seq" : seqServerUrl )
0 commit comments