refactor: Entfernen des App Loggers und Implementierung des ILogger-Interfaces; Konfiguration der API für NLog
- App Logger entfernt und durch die Implementierung des `ILogger`-Interfaces ersetzt, um eine konsistente Logging-Architektur zu gewährleisten. - API für die Nutzung von NLog konfiguriert, um eine leistungsstarke und flexible Logging-Lösung bereitzustellen. - Konfigurationsdateien und Setup-Anpassungen für die Integration von NLog in die API vorgenommen.
This commit is contained in:
@@ -3,6 +3,7 @@ using DAL.Models.Filters;
|
||||
using HRD.LDAPService;
|
||||
using HRD.WebApi.Repositories;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -14,7 +15,7 @@ namespace DAL.Repositories
|
||||
{
|
||||
private readonly LdapManager _ldapManager;
|
||||
|
||||
public EmployeeToWebAppRepository(WebApiContext context, LdapManager ldapManager) : base(context)
|
||||
public EmployeeToWebAppRepository(WebApiContext context, LdapManager ldapManager, ILogger<EmployeeToWebAppRepository> logger) : base(context, logger)
|
||||
{
|
||||
_ldapManager = ldapManager;
|
||||
}
|
||||
@@ -107,7 +108,7 @@ namespace DAL.Repositories
|
||||
|
||||
if (!result)
|
||||
{
|
||||
WriteLogError($"An error occurred while '{action}' the '{employee.LoginName}' into '{groupSuffix}'.");
|
||||
_logger.LogError($"An error occurred while '{action}' the '{employee.LoginName}' into '{groupSuffix}'.");
|
||||
return false;
|
||||
};
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user