usingNLog;usingNLog.Web;//初始化NLogvar logger =LogManager.Setup() //載入Configuration並且讀取appsetting來使用 .LoadConfigurationFromAppSettings() .GetCurrentClassLogger();try {logger.Debug("init main");var builder =WebApplication.CreateBuilder(args); // Add services to the container.builder.Logging.ClearProviders();builder.Host.UseNLog();builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbucklebuilder.Services.AddEndpointsApiExplorer();builder.Services.AddSwaggerGen(); //以下省略