Example #1
0
        public static void Main(string[] args)
        {
            Log.Logger = SerilogConfiguration.LoggerConfig();

            try
            {
                Log.Information(CommonConstants.HostStart);
                CreateHostBuilder(args).Build().Run();
            }
            catch (Exception ex)
            {
                Log.Fatal(ex, CommonConstants.HostTerminate);
            }
            finally
            {
                Log.CloseAndFlush();
            }
        }
Example #2
0
        /// <summary>
        /// Run application.
        /// </summary>
        /// <param name="args">Application arguments.</param>
        public static void Main(string[] args)
        {
            Log.Logger = SerilogConfiguration.LoggerConfig();

            try
            {
                Log.Information(InitializationConstants.WebHostStarting);

                var host = CreateHostBuilder(args).Build();

                InitialServicesScopeFactory.Build(host);

                host.Run();
            }
            catch (Exception ex)
            {
                Log.Fatal(ex, InitializationConstants.WebHostTerminated);
            }
            finally
            {
                Log.CloseAndFlush();
            }
        }