1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 16:42:50 -05:00

Added loggr logging for production environment.

This commit is contained in:
Kyle Spearrin
2016-02-06 23:45:33 -05:00
parent fea34e2826
commit ef3853d507
6 changed files with 33 additions and 4 deletions

View File

@ -16,6 +16,7 @@ using Bit.Core.Identity;
using Bit.Core.Repositories;
using Bit.Core.Services;
using Repos = Bit.Core.Repositories.SqlServer;
using Loggr.Extensions.Logging;
namespace Bit.Api
{
@ -131,12 +132,24 @@ namespace Bit.Api
});
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
public void Configure(
IApplicationBuilder app,
IHostingEnvironment env,
ILoggerFactory loggerFactory,
GlobalSettings globalSettings)
{
loggerFactory.MinimumLevel = LogLevel.Information;
loggerFactory.AddConsole();
loggerFactory.AddDebug();
if(!env.IsDevelopment())
{
loggerFactory.AddLoggr(
LogLevel.Error,
globalSettings.Loggr.LogKey,
globalSettings.Loggr.ApiKey);
}
// Add the platform handler to the request pipeline.
app.UseIISPlatformHandler();