Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += (sender, a) =>
            {
                if (Log.Logger == null) return;
                if (a.IsTerminating) Log.Logger.Fatal(a.ExceptionObject as Exception, "Unhandled Exception");
                else
                {
                    Log.Logger.Information(
                        a.ExceptionObject as Exception,
                        "Non-Fatal Unhandled Exception");
                }
            };

            app = new RunServiceApp();
            app.Run();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += (sender, a) =>
            {
                if (Log.Logger == null)
                {
                    return;
                }
                if (a.IsTerminating)
                {
                    Log.Logger.Fatal(a.ExceptionObject as Exception, "Unhandled Exception");
                }
                else
                {
                    Log.Logger.Information(
                        a.ExceptionObject as Exception,
                        "Non-Fatal Unhandled Exception");
                }
            };

            app = new RunServiceApp();
            app.Run();
        }