Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/vnext' into vnext
Browse files Browse the repository at this point in the history
  • Loading branch information
aspriddell committed Oct 16, 2023
2 parents 6998f23 + d65c34b commit 3aa5873
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<PackageReference Include="libloc.Access" Version="2023.1013.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1"/>
<PackageReference Include="Redis.OM" Version="0.5.3"/>
<PackageReference Include="Sentry.Extensions.Logging" Version="3.40.1" />
</ItemGroup>

<ItemGroup>
Expand Down
18 changes: 18 additions & 0 deletions DragonFruit.OnionFruit.Web.Worker/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,31 @@ private static void ConfigureHost(IConfigurationBuilder host)

private static void ConfigureLogging(HostBuilderContext host, ILoggingBuilder logging)
{
logging.ClearProviders();
logging.AddSimpleConsole(o =>
{
o.SingleLine = true;
o.IncludeScopes = false;
o.TimestampFormat = "[dd/MM/yyyy hh:mm:ss] ";
});

#if WINDOWS
logging.AddEventLog(o =>
{
o.Filter = (_, level) => level >= LogLevel.Information;
o.SourceName = $"OnionFruit-Web-Worker/v{Assembly.GetExecutingAssembly().GetName().Version.ToString(3)}";
});
#endif

logging.AddSentry(o =>
{
o.Dsn = host.Configuration["Worker:Dsn"] ?? host.Configuration["Dsn"];
o.Release = Assembly.GetExecutingAssembly().GetName().Version!.ToString(3);
o.MaxBreadcrumbs = 50;
o.MinimumEventLevel = LogLevel.Error;
o.MinimumBreadcrumbLevel = LogLevel.Debug;
});
}

private static void ConfigureServices(HostBuilderContext context, IServiceCollection services)
Expand Down

0 comments on commit 3aa5873

Please sign in to comment.