コード例 #1
0
ファイル: Program.cs プロジェクト: priestd09/Papercut
        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();
        }
コード例 #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();
        }