添加异常记录器,记录输出时发生异常的SQL;

This commit is contained in:
2024-01-18 15:03:45 +08:00
parent 1f9c9e0c13
commit 6ec782ec93
4 changed files with 144 additions and 12 deletions

View File

@@ -469,6 +469,7 @@ async Task RunProgram()
options.TaskCount = commandOptions.TaskCount;
options.FlushCount = commandOptions.FlushCount;
});
host.Services.AddLogging(builder =>
{
builder.ClearProviders();
@@ -484,6 +485,7 @@ async Task RunProgram()
host.Services.AddKeyedSingleton<DataRecordQueue>(ProcessStep.Producer);
host.Services.AddKeyedSingleton<DataRecordQueue>(ProcessStep.Consumer);
host.Services.AddTransient<TaskManager>();
host.Services.AddSingleton<ErrorRecorder>();
host.Services.AddHostedService<MainHostedService>();
host.Services.AddHostedService<TaskMonitorService>();