Files
server/src/Events/Program.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
1.5 KiB
C#
Raw Normal View History

2017-12-04 10:12:11 -05:00
using Bit.Core.Utilities;
namespace Bit.Events;
2022-08-29 16:06:55 -04:00
2017-12-04 10:12:11 -05:00
public class Program
{
public static void Main(string[] args)
{
2020-01-10 08:33:13 -05:00
Host
2017-12-04 10:12:11 -05:00
.CreateDefaultBuilder(args)
.ConfigureCustomAppConfiguration(args)
2020-01-10 08:33:13 -05:00
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
webBuilder.ConfigureLogging((hostingContext, logging) =>
logging.AddSerilog(hostingContext, (e, globalSettings) =>
2022-08-29 16:06:55 -04:00
{
2020-01-10 08:33:13 -05:00
var context = e.Properties["SourceContext"].ToString();
if (context.Contains("Duende.IdentityServer.Validation.TokenValidator") ||
context.Contains("Duende.IdentityServer.Validation.TokenRequestValidator"))
2019-07-23 16:38:49 -04:00
{
return e.Level >= globalSettings.MinLogLevel.EventsSettings.IdentityToken;
2020-01-10 08:33:13 -05:00
}
2019-07-23 16:38:49 -04:00
if (e.Properties.ContainsKey("RequestPath") &&
2020-01-10 08:33:13 -05:00
!string.IsNullOrWhiteSpace(e.Properties["RequestPath"]?.ToString()) &&
(context.Contains(".Server.Kestrel") || context.Contains(".Core.IISHttpServer")))
{
return false;
}
2019-09-04 12:54:19 -04:00
return e.Level >= globalSettings.MinLogLevel.EventsSettings.Default;
2020-01-10 08:33:13 -05:00
}));
})
2017-12-04 10:12:11 -05:00
.Build()
.Run();
}
}