This repository has been archived by the owner on Feb 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
50 lines (43 loc) · 1.58 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System.Text;
using nng.Constants;
using nng.Helpers;
using Sentry;
using Sentry.Extensibility;
namespace nng_bot;
public static class Program
{
public static void Main(string[] args)
{
Console.OutputEncoding = OperatingSystem.IsWindows() ? Encoding.Unicode : Encoding.UTF8;
CreateHostBuilder(args).Build().Run();
}
private static IHostBuilder CreateHostBuilder(string[] args)
{
return Host.CreateDefaultBuilder(args)
.ConfigureLogging(logging =>
{
logging.ClearProviders();
logging.AddConsole();
logging.SetMinimumLevel(LogLevel.Information);
})
.ConfigureWebHostDefaults(builder =>
{
builder.UseKestrel();
builder.UseUrls("http://*:1220");
builder.UseSentry(o =>
{
o.Dsn = "https://[email protected]/6151189";
o.MaxRequestBodySize = RequestSize.Always;
o.SendDefaultPii = true;
o.MinimumBreadcrumbLevel = LogLevel.Debug;
o.MinimumEventLevel = LogLevel.Warning;
o.AttachStacktrace = true;
o.Debug = false;
o.DiagnosticLevel = SentryLevel.Error;
var targetEnv = EnvironmentHelper.GetString(EnvironmentConstants.Sentry, "dev");
o.Environment = targetEnv;
});
builder.UseStartup<Startup>();
});
}
}