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:
@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user