Files
server/src/Admin/Program.cs

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

36 lines
1.2 KiB
C#
Raw Normal View History

2019-07-23 16:38:49 -04:00
using Bit.Core.Utilities;
2018-03-21 12:57:43 -04:00
namespace Bit.Admin;
2022-08-29 16:06:55 -04:00
2018-03-21 12:57:43 -04:00
public class Program
{
public static void Main(string[] args)
{
2020-01-10 08:33:13 -05:00
Host
2018-03-21 12:57:43 -04:00
.CreateDefaultBuilder(args)
.ConfigureCustomAppConfiguration(args)
2020-01-10 08:33:13 -05:00
.ConfigureWebHostDefaults(webBuilder =>
2022-08-29 16:06:55 -04:00
{
2019-09-04 12:54:19 -04:00
webBuilder.ConfigureKestrel(o =>
2022-08-29 14:53:16 -04:00
{
2019-09-04 12:54:19 -04:00
o.Limits.MaxRequestLineSize = 20_000;
});
2019-09-04 12:54:19 -04:00
webBuilder.UseStartup<Startup>();
webBuilder.ConfigureLogging((hostingContext, logging) =>
logging.AddSerilog(hostingContext, (e, globalSettings) =>
2022-08-29 16:06:55 -04:00
{
2019-09-04 12:54:19 -04:00
var context = e.Properties["SourceContext"].ToString();
if (e.Properties.TryGetValue("RequestPath", out var requestPath) &&
!string.IsNullOrWhiteSpace(requestPath?.ToString()) &&
2019-09-04 12:54:19 -04:00
(context.Contains(".Server.Kestrel") || context.Contains(".Core.IISHttpServer")))
{
return false;
}
return e.Level >= globalSettings.MinLogLevel.AdminSettings.Default;
2020-01-10 08:33:13 -05:00
}));
})
2018-03-21 12:57:43 -04:00
.Build()
.Run();
}
}