| | |
| | | using Autofac; |
| | | using Autofac.Core; |
| | | using Autofac.Extensions.DependencyInjection; |
| | | using Magicodes.ExporterAndImporter.Excel.Utility.TemplateExport; |
| | | using Microsoft.AspNetCore.Builder; |
| | | using Microsoft.AspNetCore.Mvc.Controllers; |
| | | using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; |
| | |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_QuartzJob.QuartzExtensions; |
| | | using WIDESEAWCS_QuartzJob.Seed; |
| | | using WIDESEAWCS_RedisService.Extensions; |
| | | using WIDESEAWCS_Server.Filter; |
| | | using WIDESEAWCS_Server.HostedService; |
| | | using WIDESEAWCS_Tasks.SocketServer; |
| | | using WIDESEAWCS_RedisService.Extensions; |
| | | using WIDESEAWCS_WCSServer.Filter; |
| | | |
| | | var builder = WebApplication.CreateBuilder(args); |
| | |
| | | .WriteTo.File( |
| | | /*Path.Combine(AppContext.BaseDirectory, "Logs", "serilog-.log"),*/ // 指定日志文件的完整路径:应用程序目录 + "Log"文件夹 + "serilog-日期.log" |
| | | "logs/serilog-.log", |
| | | rollingInterval: RollingInterval.Day, // 设置日志文件按天滚动,每天生成一个新的日志文件 |
| | | rollingInterval: RollingInterval.Day, // 设置日志文件按天滚动,每天生成一个新的日志文件 U1od4UGVsIKZG39S5Yak |
| | | retainedFileCountLimit: 30, // 最多保留最近30天的日志文件,超过30天的文件会自动删除 |
| | | shared: true); // 允许多个进程同时写入同一个日志文件,适用于多实例部署场景 |
| | | shared: true) // 允许多个进程同时写入同一个日志文件,适用于多实例部署场景 |
| | | .WriteTo.Seq( |
| | | serverUrl: "http://localhost:5341", |
| | | apiKey: "U1od4UGVsIKZG39S5Yak", // 如Seq需要ApiKey则配置真实密钥 |
| | | batchPostingLimit: 1000, // 批量发送数量 |
| | | period: TimeSpan.FromSeconds(2) // 发送间隔 |
| | | ); |
| | | }); |
| | | |
| | | builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory()).ConfigureContainer<ContainerBuilder>(builder => |