forked from nitschk/h24
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
36 lines (31 loc) · 953 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Threading;
using System.Windows.Forms;
using Serilog;
using Serilog.Events;
using Serilog.Sinks.File;
namespace h24
{
static class Program
{
/// <summary>
/// Der Haupteinstiegspunkt für die Anwendung.
/// </summary>
[STAThread]
static void Main()
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.File("logs/h24.txt", rollingInterval: RollingInterval.Day)
.CreateLogger();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.ThreadException += new ThreadExceptionEventHandler(HandleUnhandledException);
Application.Run(new FrmMain());
}
private static void HandleUnhandledException(object sender, ThreadExceptionEventArgs e)
{
MessageBox.Show($"Not caught exceptions:\n{e.Exception.Message}\n{e.Exception.StackTrace}");
}
}
}