mirror of
https://github.com/bitwarden/server.git
synced 2025-05-20 19:14:32 -05: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;
|
set => _logDirectory = value;
|
||||||
}
|
}
|
||||||
public virtual long? LogRollBySizeLimit { get; set; }
|
public virtual long? LogRollBySizeLimit { get; set; }
|
||||||
|
public virtual bool EnableDevLogging { get; set; } = false;
|
||||||
public virtual string LicenseDirectory
|
public virtual string LicenseDirectory
|
||||||
{
|
{
|
||||||
get => BuildDirectory(_licenseDirectory, "/core/licenses");
|
get => BuildDirectory(_licenseDirectory, "/core/licenses");
|
||||||
|
@ -20,7 +20,7 @@ public static class LoggerFactoryExtensions
|
|||||||
IHostApplicationLifetime applicationLifetime,
|
IHostApplicationLifetime applicationLifetime,
|
||||||
GlobalSettings globalSettings)
|
GlobalSettings globalSettings)
|
||||||
{
|
{
|
||||||
if (env.IsDevelopment())
|
if (env.IsDevelopment() && !globalSettings.EnableDevLogging)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -33,14 +33,14 @@ public static class LoggerFactoryExtensions
|
|||||||
WebHostBuilderContext context,
|
WebHostBuilderContext context,
|
||||||
Func<LogEvent, IGlobalSettings, bool> filter = null)
|
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;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
var globalSettings = new GlobalSettings();
|
|
||||||
ConfigurationBinder.Bind(context.Configuration.GetSection("GlobalSettings"), globalSettings);
|
|
||||||
|
|
||||||
bool inclusionPredicate(LogEvent e)
|
bool inclusionPredicate(LogEvent e)
|
||||||
{
|
{
|
||||||
if (filter == null)
|
if (filter == null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user