| | |
| | | services.AddConsoleFormatter(options => |
| | | { |
| | | options.WithTraceId = true; |
| | | options.WithStackFrame = true; |
| | | }); |
| | | |
| | | services.AddFileLogging(options => |
| | | { |
| | | options.WithTraceId = true; |
| | | options.WithStackFrame = true; |
| | | options.FileNameRule = fileName => |
| | | { |
| | | return string.Format(fileName, DateTime.UtcNow); // 如果是本地时间使用 DateTime.Now |
| | |
| | | services.AddDatabaseLogging<DatabaseLoggingWriter>(options => |
| | | { |
| | | options.WithTraceId = true; |
| | | options.WithStackFrame = true; |
| | | }); |
| | | |
| | | services.AddConfigurableOptions<AliyunOptions>(); |
| | |
| | | .AddFriendlyException() |
| | | .AddDataValidation() |
| | | .AddInjectWithUnifyResult<FriendlyResultProvider>(); |
| | | |
| | | services.AddMvcFilter<ResourceActionFilter>(); |
| | | } |
| | | |
| | | public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime lifetime) |