Files
server/src/Identity/Program.cs

39 lines
1.3 KiB
C#
Raw Normal View History

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