feat: 完成日志模块

This commit is contained in:
陈淳
2023-12-12 17:16:28 +08:00
parent 8921b319c8
commit ac7a1acee3
8 changed files with 129 additions and 1695 deletions

View File

@@ -222,7 +222,7 @@ namespace Yi.Framework.SqlSugarCore
{
if (Options.EnabledSqlLog)
{
Logger.CreateLogger<SqlSugarDbContext>().LogDebug("SQL执行:"+UtilMethods.GetSqlString(DbType.SqlServer, sql, pars));
Logger.CreateLogger<SqlSugarDbContext>().LogDebug("Yi-SQL执行:"+UtilMethods.GetSqlString(DbType.SqlServer, sql, pars));
}
}

View File

@@ -20,8 +20,7 @@ namespace Yi.Framework.SqlSugarCore
}
public Task SaveAsync(AuditLogInfo auditInfo)
{
_logger.LogDebug(JsonHelper.ObjToStr(auditInfo, "yyyy-MM-dd HH:mm:ss"));
//Console.WriteLine(auditInfo.ExecutionTime);
_logger.LogDebug("Yi-请求追踪:"+JsonHelper.ObjToStr(auditInfo, "yyyy-MM-dd HH:mm:ss"));
return Task.CompletedTask;
}
}

View File

@@ -15,11 +15,6 @@ namespace Yi.Framework.SqlSugarCore.Uow
public async Task CommitAsync(CancellationToken cancellationToken = default)
{
await Console.Out.WriteLineAsync("事务提交");
Console.WriteLine(_sqlsugarDbContext.SqlSugarClient.ContextID + "---------------");
await _sqlsugarDbContext.SqlSugarClient.Ado.CommitTranAsync();
}
@@ -30,8 +25,6 @@ namespace Yi.Framework.SqlSugarCore.Uow
public async Task RollbackAsync(CancellationToken cancellationToken = default)
{
await Console.Out.WriteLineAsync("事务回滚");
Console.WriteLine(_sqlsugarDbContext.SqlSugarClient.ContextID);
await _sqlsugarDbContext.SqlSugarClient.Ado.RollbackTranAsync();
}
}