Refactored the error params, so that exception is before the message/template so its more in sync with Serilog signature & was an easy way to find some more logs I missed too

This commit is contained in:
Warren
2018-08-17 15:41:58 +01:00
parent 38984181fc
commit 9e996c68bb
98 changed files with 219 additions and 223 deletions

View File

@@ -127,7 +127,7 @@ namespace Umbraco.Web.Install.Controllers
catch (Exception ex)
{
_logger.Error<InstallApiController>("An error occurred during installation step " + step.Name, ex);
_logger.Error<InstallApiController>(ex, "An error occurred during installation step {Step}", step.Name);
if (ex is TargetInvocationException && ex.InnerException != null)
{
@@ -217,7 +217,7 @@ namespace Umbraco.Web.Install.Controllers
}
catch (Exception ex)
{
_logger.Error<InstallApiController>("Checking if step requires execution (" + step.Name + ") failed.", ex);
_logger.Error<InstallApiController>(ex, "Checking if step requires execution ({Step}) failed.", step.Name);
throw;
}
}
@@ -225,7 +225,7 @@ namespace Umbraco.Web.Install.Controllers
// executes the step
internal InstallSetupResult ExecuteStep(InstallSetupStep step, JToken instruction)
{
using (_proflog.TraceDuration<InstallApiController>("Executing installation step: " + step.Name, "Step completed"))
using (_proflog.TraceDuration<InstallApiController>("Executing installation step: '{Step}' Step completed", step.Name))
{
var model = instruction?.ToObject(step.StepType);
var genericStepType = typeof(InstallSetupStep<>);
@@ -238,7 +238,7 @@ namespace Umbraco.Web.Install.Controllers
}
catch (Exception ex)
{
_logger.Error<InstallApiController>("Installation step " + step.Name + " failed.", ex);
_logger.Error<InstallApiController>(ex, "Installation step {Step} failed.", step.Name);
throw;
}
}