mirror of
https://github.com/bitwarden/server
synced 2025-12-16 08:13:33 +00:00
cleanup startup logging
This commit is contained in:
@@ -149,8 +149,7 @@ namespace Bit.Api
|
||||
IApplicationLifetime appLifetime,
|
||||
GlobalSettings globalSettings)
|
||||
{
|
||||
loggerFactory
|
||||
.AddSerilog(env, appLifetime, globalSettings, (e) =>
|
||||
loggerFactory.AddSerilog(env, appLifetime, globalSettings, (e) =>
|
||||
{
|
||||
var context = e.Properties["SourceContext"].ToString();
|
||||
if(e.Exception != null && (e.Exception.GetType() == typeof(SecurityTokenValidationException) ||
|
||||
|
||||
@@ -64,8 +64,7 @@ namespace Bit.Billing
|
||||
GlobalSettings globalSettings,
|
||||
ILoggerFactory loggerFactory)
|
||||
{
|
||||
loggerFactory
|
||||
.AddSerilog(env, appLifetime, globalSettings, (e) => e.Level >= LogEventLevel.Error);
|
||||
loggerFactory.AddSerilog(env, appLifetime, globalSettings, (e) => e.Level >= LogEventLevel.Error);
|
||||
|
||||
if(env.IsDevelopment())
|
||||
{
|
||||
|
||||
@@ -46,17 +46,17 @@ namespace Bit.Icons
|
||||
IHostingEnvironment env,
|
||||
TelemetryConfiguration telemetry)
|
||||
{
|
||||
if(env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
telemetry.DisableTelemetry = true;
|
||||
}
|
||||
catch { }
|
||||
|
||||
if(env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
app.UseResponseCaching();
|
||||
app.UseMvc();
|
||||
}
|
||||
|
||||
@@ -72,8 +72,7 @@ namespace Bit.Identity
|
||||
IApplicationLifetime appLifetime,
|
||||
GlobalSettings globalSettings)
|
||||
{
|
||||
loggerFactory
|
||||
.AddSerilog(env, appLifetime, globalSettings, (e) =>
|
||||
loggerFactory.AddSerilog(env, appLifetime, globalSettings, (e) =>
|
||||
{
|
||||
var context = e.Properties["SourceContext"].ToString();
|
||||
if(context.Contains("IdentityServer4.Validation.TokenRequestValidator"))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.IO;
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
||||
namespace Bit.Mail
|
||||
@@ -7,14 +7,11 @@ namespace Bit.Mail
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var host = new WebHostBuilder()
|
||||
.UseKestrel()
|
||||
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||
.UseIISIntegration()
|
||||
WebHost
|
||||
.CreateDefaultBuilder(args)
|
||||
.UseStartup<Startup>()
|
||||
.Build();
|
||||
|
||||
host.Run();
|
||||
.Build()
|
||||
.Run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user