mirror of
https://github.com/bitwarden/server.git
synced 2024-11-25 12:45:18 +01:00
[EC-588] Add secrets override for dev logging (#2309)
This commit is contained in:
parent
0629394cec
commit
96fa8781f3
@ -25,6 +25,7 @@ public class GlobalSettings : IGlobalSettings
|
||||
set => _logDirectory = value;
|
||||
}
|
||||
public virtual long? LogRollBySizeLimit { get; set; }
|
||||
public virtual bool EnableDevLogging { get; set; } = false;
|
||||
public virtual string LicenseDirectory
|
||||
{
|
||||
get => BuildDirectory(_licenseDirectory, "/core/licenses");
|
||||
|
@ -20,7 +20,7 @@ public static class LoggerFactoryExtensions
|
||||
IHostApplicationLifetime applicationLifetime,
|
||||
GlobalSettings globalSettings)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
if (env.IsDevelopment() && !globalSettings.EnableDevLogging)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -33,14 +33,14 @@ public static class LoggerFactoryExtensions
|
||||
WebHostBuilderContext context,
|
||||
Func<LogEvent, IGlobalSettings, bool> filter = null)
|
||||
{
|
||||
if (context.HostingEnvironment.IsDevelopment())
|
||||
var globalSettings = new GlobalSettings();
|
||||
ConfigurationBinder.Bind(context.Configuration.GetSection("GlobalSettings"), globalSettings);
|
||||
|
||||
if (context.HostingEnvironment.IsDevelopment() && !globalSettings.EnableDevLogging)
|
||||
{
|
||||
return builder;
|
||||
}
|
||||
|
||||
var globalSettings = new GlobalSettings();
|
||||
ConfigurationBinder.Bind(context.Configuration.GetSection("GlobalSettings"), globalSettings);
|
||||
|
||||
bool inclusionPredicate(LogEvent e)
|
||||
{
|
||||
if (filter == null)
|
||||
|
Loading…
Reference in New Issue
Block a user