| | |
| | | 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 |
| | | return string.Format(fileName, DateTime.Now); |
| | | }; |
| | | }); |
| | | |
| | | services.AddDatabaseLogging<DatabaseLoggingWriter>(options => |
| | | { |
| | | options.WithTraceId = true; |
| | | options.WithStackFrame = true; |
| | | }); |
| | | //services.AddDatabaseLogging<DatabaseLoggingWriter>(options => |
| | | //{ |
| | | // options.WithTraceId = true; |
| | | //}); |
| | | |
| | | services.AddConfigurableOptions<AliyunOptions>(); |
| | | |
| | | services.AddHttpRemote(); |
| | | |
| | | services.AddComponent<ConsulServiceComponent>(); |
| | | |
| | |
| | | |
| | | services.AddComponent<DistributedCacheServiceComponent>(); |
| | | |
| | | services.AddHttpRemote(); |
| | | services.AddSingleton<ResourceHttpUtils>(); |
| | | |
| | | services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblies(App.Assemblies.ToArray())); |
| | | |
| | | services.AddHostedService<XmlDocBuildHostedService>(); |
| | | services.AddHostedService<BuildDynamicControllersHostedService>(); |
| | | |
| | | services.AddJwt<JwtHandler>(enableGlobalAuthorize: true); |
| | | |
| | | services.AddCorsAccessor(); |
| | | |
| | | services.AddHostedService<BuildDynamicControllersHostedService>(); |
| | | |
| | | services.AddSpecificationDocuments(options => |
| | | { |
| | |
| | | .AddFriendlyException() |
| | | .AddDataValidation() |
| | | .AddInjectWithUnifyResult<FriendlyResultProvider>(); |
| | | |
| | | services.AddMvcFilter<ResourceActionFilter>(); |
| | | } |
| | | |
| | | public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime lifetime) |