Logging Enhancements (#285)

* If the user is on Debug, allow logging DB params to the logger. Implemented the ability to change logger from UI and to keep the DB settings of LogLevel and Port in sync with appsettings.

* Exclude a lot more clutter from hitting Sentry

* Removed github action

* Small cleanup
This commit is contained in:
Joseph Milazzo
2021-06-07 17:52:11 -05:00
committed by GitHub
parent 6f124b6f8a
commit 7dae1da92f
6 changed files with 81 additions and 16 deletions
+3 -1
View File
@@ -37,6 +37,7 @@ namespace API.Controllers
{
var settingsDto = await _unitOfWork.SettingsRepository.GetSettingsDtoAsync();
settingsDto.Port = Configuration.GetPort(Program.GetAppSettingFilename());
settingsDto.LoggingLevel = Configuration.GetLogLevel(Program.GetAppSettingFilename());
return Ok(settingsDto);
}
@@ -87,6 +88,7 @@ namespace API.Controllers
if (setting.Key == ServerSettingKey.LoggingLevel && updateSettingsDto.LoggingLevel + "" != setting.Value)
{
setting.Value = updateSettingsDto.LoggingLevel + "";
Configuration.UpdateLogLevel(Program.GetAppSettingFilename(), updateSettingsDto.LoggingLevel);
_unitOfWork.SettingsRepository.Update(setting);
}
}
@@ -120,7 +122,7 @@ namespace API.Controllers
[HttpGet("log-levels")]
public ActionResult<IEnumerable<string>> GetLogLevels()
{
return Ok(new [] {"Trace", "Debug", "Information", "Warning", "Critical", "None"});
return Ok(new [] {"Trace", "Debug", "Information", "Warning", "Critical"});
}
}
}