2017-12-04 10:12:11 -05:00
|
|
|
|
using Microsoft.AspNetCore;
|
|
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
2019-07-23 16:38:49 -04:00
|
|
|
|
using Bit.Core.Utilities;
|
|
|
|
|
|
using Serilog.Events;
|
2017-12-04 10:12:11 -05:00
|
|
|
|
|
|
|
|
|
|
namespace Bit.Events
|
|
|
|
|
|
{
|
|
|
|
|
|
public class Program
|
|
|
|
|
|
{
|
|
|
|
|
|
public static void Main(string[] args)
|
|
|
|
|
|
{
|
|
|
|
|
|
WebHost
|
|
|
|
|
|
.CreateDefaultBuilder(args)
|
|
|
|
|
|
.UseStartup<Startup>()
|
2019-07-23 16:38:49 -04:00
|
|
|
|
.ConfigureLogging((hostingContext, logging) =>
|
|
|
|
|
|
logging.AddSerilog(hostingContext, e =>
|
|
|
|
|
|
{
|
|
|
|
|
|
var context = e.Properties["SourceContext"].ToString();
|
|
|
|
|
|
if(context.Contains("IdentityServer4.Validation.TokenValidator") ||
|
|
|
|
|
|
context.Contains("IdentityServer4.Validation.TokenRequestValidator"))
|
|
|
|
|
|
{
|
|
|
|
|
|
return e.Level > LogEventLevel.Error;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return e.Level >= LogEventLevel.Error;
|
|
|
|
|
|
}))
|
2017-12-04 10:12:11 -05:00
|
|
|
|
.Build()
|
|
|
|
|
|
.Run();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|