Compare commits

..

No commits in common. "d0b73977a6ae3290942495b5b0695adb4399bb8e" and "15701ef07355ee26ed08b32157be1f0958545490" have entirely different histories.

3 changed files with 12 additions and 10 deletions

View File

@ -1,5 +1,4 @@
using DocumentFormat.OpenXml.Bibliography;
using Serilog;
using Serilog;
using Serilog.Events;
using Serilog.Formatting.Compact;
@ -30,13 +29,11 @@ namespace IRaCIS.Core.API
.Filter.ByExcluding(logEvent => logEvent.Properties.ContainsKey("RequestPath") && logEvent.Properties["RequestPath"].ToString().Contains("/health"))
//https://github.com/serilog/serilog-formatting-compact
// 控制台输出 JSON 格式
.WriteTo.Console(formatter: new CompactJsonFormatter(),LogEventLevel.Warning)
.WriteTo.Console()
.WriteTo.File($"{AppContext.BaseDirectory}Serilogs/.log", rollingInterval: RollingInterval.Day);
//// 控制台输出 JSON 格式
//.WriteTo.Console(formatter: new CompactJsonFormatter(), LogEventLevel.Warning),
//// 文件输出 JSON 格式
//.WriteTo.File(new CompactJsonFormatter(), $"{AppContext.BaseDirectory}Serilogs/.json", rollingInterval: RollingInterval.Day);
// 文件输出 JSON 格式
.WriteTo.File(new CompactJsonFormatter(), $"{AppContext.BaseDirectory}Serilogs/.json", rollingInterval: RollingInterval.Day);
////控制台 方便调试 问题 我们显示记录日志 时 获取上下文的ip 和用户名 用户类型
//.WriteTo.Console(restrictedToMinimumLevel: LogEventLevel.Warning,

View File

@ -57,7 +57,6 @@ public class ProjectExceptionFilter(ILogger<ProjectExceptionFilter> _logger, ISt
_logger.LogError(errorInfo);
//_logger.LogError(exception, exception.Message);
}
else
{

View File

@ -33,6 +33,12 @@ using System.Text;
namespace IRaCIS.Core.Application.Service
{
[ApiExplorerSettings(GroupName = "Institution")]
public class TestService(IRepository<Dictionary> _dicRepository,
IRepository<Trial> _trialRepository,