integración nueva tabla

This commit is contained in:
bcastrogallardo 2025-07-16 20:39:24 -04:00
parent 5db07294f9
commit 657fd50ac9
22 changed files with 203 additions and 447 deletions

View file

@ -10,7 +10,7 @@ namespace Shared.Helper
{
public static void ConfigureLogger(IConfiguration configuration)
{
var logFilePath = configuration.GetSection("Logging:LogFile:Path").Value;
var logFilePath = configuration.GetSection("Logging:LogFile:Path").Value ?? "";
var logFileFullPath = Path.Combine(Directory.GetCurrentDirectory(), logFilePath);
Log.Logger = new LoggerConfiguration()
@ -28,31 +28,5 @@ namespace Shared.Helper
{
Log.Error(ex, message);
}
public static async Task<bool> InsertarLogsAsync(string evento, string proceso, string operacion)
{
try
{
using var connection = new SqlConnection(BdConexion.StringConnection);
await connection.OpenAsync();
string sql = @"INSERT INTO DGA_LOGS_REGISTROS_ENVIOS (evento, proceso, operacion)
VALUES (@evento, @proceso, @operacion)";
await connection.ExecuteAsync(sql, new
{
evento,
proceso,
operacion
});
return true;
}
catch (Exception e)
{
LogError("Error al insertar logs", e);
return false;
}
}
}
}