Standardize error logging with LogError method

Replaced all usages of _logger?.Error with _logger?.LogError in FinalizeDocumentJob.cs. Renamed the Error method to LogError in Logging.cs for consistency. This change ensures uniform error logging across the codebase.
This commit is contained in:
2026-02-25 13:43:51 +01:00
parent b8fd26611c
commit 1a0973075b
2 changed files with 3 additions and 3 deletions

View File

@@ -293,7 +293,7 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
if (_actionService?.CompleteEnvelope(envelope) == false)
{
_logger?.Error(new Exception("CompleteEnvelope failed"), "Envelope could not be completed for receiver [{0}]", envelope.User?.Email);
_logger?.LogError(new Exception("CompleteEnvelope failed"), "Envelope could not be completed for receiver [{0}]", envelope.User?.Email);
return false;
}
@@ -309,7 +309,7 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
{
if (_actionService?.CompleteEnvelope(envelope, receiver.Receiver) == false)
{
_logger?.Error(new Exception("CompleteEnvelope failed"), "Envelope could not be completed for receiver [{0}]", receiver.Receiver?.EmailAddress);
_logger?.LogError(new Exception("CompleteEnvelope failed"), "Envelope could not be completed for receiver [{0}]", receiver.Receiver?.EmailAddress);
return false;
}
}

View File

@@ -23,7 +23,7 @@ public class Logger
public void Error(Exception exception) => logger.LogError(exception, exception.Message);
public void Error(Exception exception, string message, params object?[] args) => Write("ERROR", message + " " + exception.Message, args);
public void LogError(Exception exception, string message, params object?[] args) => Write("ERROR", message + " " + exception.Message, args);
private static void Write(string level, string message, params object?[] args)
{