public IActionResult Write([FromBody] LogRequest request) { if (!ModelState.IsValid) { return(BadRequest(ErrorResponseFactory.Create(ModelState))); } var logFactory = _logFactoryStorage.GetLogFactoryOrDefault(request.AppName); if (logFactory == null) { _log.Warning(nameof(Write), $"Logger for appName {request.AppName} not found", context: request); return(BadRequest(ErrorResponse.Create($"Logger for appName {request.AppName} not found"))); } var logInformation = request.MapToLogInformationDto(); if (request.LogLevel == LogLevelContract.Monitor) { var healthNotifier = _healthNotifierStorage.GetOrCreateHealthNotifier(request.AppName, request.AppVersion, request.EnvInfo, logFactory); _healthNotificationWriter.SendNotification(healthNotifier, logInformation); return(Ok()); } _logWriter.Write(logFactory, request.LogLevel.MapToMicrosoftLoglevel(), logInformation); return(Ok()); }