Example #1
0
        public static void Main(string[] args)
        {
            SerilogExtensions.AddSerilog(Configuration);

            Serilog.Debugging.SelfLog.Enable(msg =>
            {
                Debug.WriteLine(msg);
            });

            Serilog.Debugging.SelfLog.Enable(Console.Error);

            try
            {
                Log.Information("Getting the motors running...");

                CreateHostBuilder(args).Build().Run();
            }
            catch (Exception ex)
            {
                Log.Fatal(ex, "Host terminated unexpectedly");
            }
            finally
            {
                Log.CloseAndFlush();
            }
        }
Example #2
0
        public static void Main(string[] args)
        {
            SerilogExtensions.AddSerilog(Configuration);

            try
            {
                CreateHostBuilder(args).Build().Run();
            }
            catch (Exception ex)
            {
                Log.Fatal(ex, "Host terminated unexpectedly");
            }
            finally
            {
                Log.CloseAndFlush();
            }
        }
Example #3
0
        public static void Main(string[] args)
        {
            SerilogExtensions.AddSerilog(Configuration);

            CreateHostBuilder(args).Build().Run();
        }