1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-09 23:28:12 -05:00

cleanup startup logging

This commit is contained in:
Kyle Spearrin 2017-10-23 09:11:25 -04:00
parent 21f614bb2e
commit 5069814c4f
5 changed files with 40 additions and 46 deletions

View File

@ -149,8 +149,7 @@ namespace Bit.Api
IApplicationLifetime appLifetime, IApplicationLifetime appLifetime,
GlobalSettings globalSettings) GlobalSettings globalSettings)
{ {
loggerFactory loggerFactory.AddSerilog(env, appLifetime, globalSettings, (e) =>
.AddSerilog(env, appLifetime, globalSettings, (e) =>
{ {
var context = e.Properties["SourceContext"].ToString(); var context = e.Properties["SourceContext"].ToString();
if(e.Exception != null && (e.Exception.GetType() == typeof(SecurityTokenValidationException) || if(e.Exception != null && (e.Exception.GetType() == typeof(SecurityTokenValidationException) ||

View File

@ -64,8 +64,7 @@ namespace Bit.Billing
GlobalSettings globalSettings, GlobalSettings globalSettings,
ILoggerFactory loggerFactory) ILoggerFactory loggerFactory)
{ {
loggerFactory loggerFactory.AddSerilog(env, appLifetime, globalSettings, (e) => e.Level >= LogEventLevel.Error);
.AddSerilog(env, appLifetime, globalSettings, (e) => e.Level >= LogEventLevel.Error);
if(env.IsDevelopment()) if(env.IsDevelopment())
{ {

View File

@ -46,17 +46,17 @@ namespace Bit.Icons
IHostingEnvironment env, IHostingEnvironment env,
TelemetryConfiguration telemetry) TelemetryConfiguration telemetry)
{ {
if(env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
try try
{ {
telemetry.DisableTelemetry = true; telemetry.DisableTelemetry = true;
} }
catch { } catch { }
if(env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseResponseCaching(); app.UseResponseCaching();
app.UseMvc(); app.UseMvc();
} }

View File

@ -72,8 +72,7 @@ namespace Bit.Identity
IApplicationLifetime appLifetime, IApplicationLifetime appLifetime,
GlobalSettings globalSettings) GlobalSettings globalSettings)
{ {
loggerFactory loggerFactory.AddSerilog(env, appLifetime, globalSettings, (e) =>
.AddSerilog(env, appLifetime, globalSettings, (e) =>
{ {
var context = e.Properties["SourceContext"].ToString(); var context = e.Properties["SourceContext"].ToString();
if(context.Contains("IdentityServer4.Validation.TokenRequestValidator")) if(context.Contains("IdentityServer4.Validation.TokenRequestValidator"))

View File

@ -1,4 +1,4 @@
using System.IO; using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
namespace Bit.Mail namespace Bit.Mail
@ -7,14 +7,11 @@ namespace Bit.Mail
{ {
public static void Main(string[] args) public static void Main(string[] args)
{ {
var host = new WebHostBuilder() WebHost
.UseKestrel() .CreateDefaultBuilder(args)
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>() .UseStartup<Startup>()
.Build(); .Build()
.Run();
host.Run();
} }
} }
} }