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:
@@ -293,7 +293,7 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
|
|||||||
|
|
||||||
if (_actionService?.CompleteEnvelope(envelope) == false)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,7 +309,7 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
|
|||||||
{
|
{
|
||||||
if (_actionService?.CompleteEnvelope(envelope, receiver.Receiver) == false)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class Logger
|
|||||||
|
|
||||||
public void Error(Exception exception) => logger.LogError(exception, exception.Message);
|
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)
|
private static void Write(string level, string message, params object?[] args)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user