1
0
mirror of https://github.com/bitwarden/server.git synced 2025-03-02 04:11:04 +01:00
bitwarden-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 22:38:49 +02:00
using Bit.Core.Utilities;
2018-03-21 17:57:43 +01:00
namespace Bit.Admin;
2022-08-29 22:06:55 +02:00
2018-03-21 17:57:43 +01:00
public class Program
{
public static void Main(string[] args)
{
2020-01-10 14:33:13 +01:00
Host
2018-03-21 17:57:43 +01:00
.CreateDefaultBuilder(args)
.ConfigureCustomAppConfiguration(args)
2020-01-10 14:33:13 +01:00
.ConfigureWebHostDefaults(webBuilder =>
2022-08-29 22:06:55 +02:00
{
2019-09-04 18:54:19 +02:00
webBuilder.ConfigureKestrel(o =>
2022-08-29 20:53:16 +02:00
{
2019-09-04 18:54:19 +02:00
o.Limits.MaxRequestLineSize = 20_000;
});
2019-09-04 18:54:19 +02:00
webBuilder.UseStartup<Startup>();
webBuilder.ConfigureLogging((hostingContext, logging) =>
logging.AddSerilog(hostingContext, (e, globalSettings) =>
2022-08-29 22:06:55 +02:00
{
2019-09-04 18:54:19 +02:00
var context = e.Properties["SourceContext"].ToString();
if (e.Properties.ContainsKey("RequestPath") &&
2019-09-04 18:54:19 +02:00
!string.IsNullOrWhiteSpace(e.Properties["RequestPath"]?.ToString()) &&
(context.Contains(".Server.Kestrel") || context.Contains(".Core.IISHttpServer")))
{
return false;
}
return e.Level >= globalSettings.MinLogLevel.AdminSettings.Default;
2020-01-10 14:33:13 +01:00
}));
})
2018-03-21 17:57:43 +01:00
.Build()
.Run();
}
}