-
-
Notifications
You must be signed in to change notification settings - Fork 230
Expand file tree
/
Copy pathProgram.cs
More file actions
21 lines (16 loc) · 678 Bytes
/
Program.cs
File metadata and controls
21 lines (16 loc) · 678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Sentry.Samples.GenericHost;
var builder = Host.CreateApplicationBuilder();
builder.Logging.AddConfiguration(builder.Configuration);
#if !SENTRY_DSN_DEFINED_IN_ENV
// A DSN is required. You can set it here in code, via the SENTRY_DSN environment variable or in your
// appsettings.json file.
// See https://docs.sentry.io/platforms/dotnet/guides/aspnetcore/#configure
builder.Logging.AddSentry(SamplesShared.Dsn);
#else
builder.Logging.AddSentry();
#endif
builder.Services.AddHostedService<SampleHostedService>();
await builder.Build().RunAsync();