public async Task <ActionResult> Level(string logLevel, string application) { application = application ?? string.Empty; if (application == CcmApplications.Web) { var wasSet = LogLevelManager.SetLogLevel(logLevel); if (wasSet) { log.Info("Log level changed to {0}", logLevel); } else { log.Info("Log level was NOT changed. ({0})", logLevel); } } else if (application == CcmApplications.Discovery) { var result = await SetDiscoveryLogLevelAsync(logLevel); if (result != logLevel) { ViewBag.CurrentLevel = logLevel; ViewBag.Application = application; return(View()); } } return(RedirectToAction("Index", new { application })); }
public ActionResult <string> SetLogLevel([FromBody] SetLogLevelRequest request) { LogLevelManager.SetLogLevel(request.LogLevel); var newLevel = LogLevelManager.GetCurrentLevel().Name; return(newLevel); }
public LevelModel Post(LevelModel levelModel) { if (levelModel != null) { var isSet = LogLevelManager.SetLogLevel(levelModel.LogLevel); if (isSet) { log.Info("Log level changed to {0}", levelModel.LogLevel); } else { log.Info("Log level was NOT changed."); } } return(Get()); }