107 changed files with 1762 additions and 2121 deletions
@ -1,46 +1,36 @@ |
|||||
using System; |
using System; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using EShopOnAbp.Shared.Hosting.AspNetCore; |
using EShopOnAbp.Shared.Hosting.AspNetCore; |
||||
using Microsoft.AspNetCore.Hosting; |
using Microsoft.AspNetCore.Builder; |
||||
using Microsoft.Extensions.Configuration; |
|
||||
using Microsoft.Extensions.Hosting; |
|
||||
using Serilog; |
using Serilog; |
||||
|
|
||||
namespace EShopOnAbp.AuthServer |
namespace EShopOnAbp.AuthServer; |
||||
|
|
||||
|
public class Program |
||||
{ |
{ |
||||
public class Program |
public static async Task<int> Main(string[] args) |
||||
{ |
{ |
||||
public static async Task<int> Main(string[] args) |
var assemblyName = typeof(Program).Assembly.GetName().Name; |
||||
{ |
|
||||
var assemblyName = typeof(Program).Assembly.GetName().Name; |
|
||||
|
|
||||
SerilogConfigurationHelper.Configure(assemblyName); |
SerilogConfigurationHelper.Configure(assemblyName); |
||||
|
|
||||
try |
try |
||||
{ |
{ |
||||
Log.Information($"Starting {assemblyName}."); |
Log.Information($"Starting {assemblyName}."); |
||||
await CreateHostBuilder(args).Build().RunAsync(); |
var app = await ApplicationBuilderHelper.BuildApplicationAsync<EShopOnAbpAuthServerModule>(args); |
||||
return 0; |
await app.InitializeApplicationAsync(); |
||||
} |
await app.RunAsync(); |
||||
catch (Exception ex) |
|
||||
{ |
|
||||
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); |
|
||||
return 1; |
|
||||
} |
|
||||
finally |
|
||||
{ |
|
||||
Log.CloseAndFlush(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
internal static IHostBuilder CreateHostBuilder(string[] args) => |
return 0; |
||||
Host.CreateDefaultBuilder(args) |
} |
||||
.ConfigureAppConfiguration(build => |
catch (Exception ex) |
||||
{ |
{ |
||||
build.AddJsonFile("appsettings.secrets.json", optional: true); |
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); |
||||
}) |
return 1; |
||||
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }) |
} |
||||
.UseAutofac() |
finally |
||||
.UseSerilog(); |
{ |
||||
|
Log.CloseAndFlush(); |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
@ -1,19 +0,0 @@ |
|||||
using Microsoft.AspNetCore.Builder; |
|
||||
using Microsoft.AspNetCore.Hosting; |
|
||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
|
|
||||
namespace EShopOnAbp.AuthServer |
|
||||
{ |
|
||||
public class Startup |
|
||||
{ |
|
||||
public void ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
services.AddApplication<EShopOnAbpAuthServerModule>(); |
|
||||
} |
|
||||
|
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) |
|
||||
{ |
|
||||
app.InitializeApplication(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,52 +1,36 @@ |
|||||
using System; |
using System; |
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using EShopOnAbp.Shared.Hosting.AspNetCore; |
using EShopOnAbp.Shared.Hosting.AspNetCore; |
||||
using Microsoft.AspNetCore.Hosting; |
using Microsoft.AspNetCore.Builder; |
||||
using Microsoft.Extensions.Configuration; |
|
||||
using Microsoft.Extensions.Hosting; |
|
||||
using Microsoft.Extensions.Logging; |
|
||||
using Serilog; |
using Serilog; |
||||
|
|
||||
namespace EShopOnAbp.PublicWeb |
namespace EShopOnAbp.PublicWeb; |
||||
|
|
||||
|
public class Program |
||||
{ |
{ |
||||
public class Program |
public static async Task<int> Main(string[] args) |
||||
{ |
{ |
||||
public static async Task<int> Main(string[] args) |
var assemblyName = typeof(Program).Assembly.GetName().Name; |
||||
{ |
|
||||
var assemblyName = typeof(Program).Assembly.GetName().Name; |
|
||||
|
|
||||
SerilogConfigurationHelper.Configure(assemblyName); |
SerilogConfigurationHelper.Configure(assemblyName); |
||||
|
|
||||
try |
try |
||||
{ |
{ |
||||
Log.Information($"Starting {assemblyName}."); |
Log.Information($"Starting {assemblyName}."); |
||||
await CreateHostBuilder(args).Build().RunAsync(); |
var app = await ApplicationBuilderHelper.BuildApplicationAsync<EShopOnAbpPublicWebModule>(args); |
||||
return 0; |
await app.InitializeApplicationAsync(); |
||||
} |
await app.RunAsync(); |
||||
catch (Exception ex) |
|
||||
{ |
|
||||
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); |
|
||||
return 1; |
|
||||
} |
|
||||
finally |
|
||||
{ |
|
||||
Log.CloseAndFlush(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
internal static IHostBuilder CreateHostBuilder(string[] args) => |
return 0; |
||||
Host.CreateDefaultBuilder(args) |
} |
||||
.ConfigureAppConfiguration(build => |
catch (Exception ex) |
||||
{ |
{ |
||||
build.AddJsonFile("appsettings.secrets.json", optional: true); |
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); |
||||
}) |
return 1; |
||||
.ConfigureWebHostDefaults(webBuilder => |
} |
||||
{ |
finally |
||||
webBuilder.UseStartup<Startup>(); |
{ |
||||
}) |
Log.CloseAndFlush(); |
||||
.UseAutofac() |
} |
||||
.UseSerilog(); |
|
||||
} |
} |
||||
} |
} |
||||
@ -1,25 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Threading.Tasks; |
|
||||
using Microsoft.AspNetCore.Builder; |
|
||||
using Microsoft.AspNetCore.Hosting; |
|
||||
using Microsoft.AspNetCore.Http; |
|
||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
using Microsoft.Extensions.Hosting; |
|
||||
|
|
||||
namespace EShopOnAbp.PublicWeb |
|
||||
{ |
|
||||
public class Startup |
|
||||
{ |
|
||||
public void ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
services.AddApplication<EShopOnAbpPublicWebModule>(); |
|
||||
} |
|
||||
|
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) |
|
||||
{ |
|
||||
app.InitializeApplication(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,46 +1,36 @@ |
|||||
using EShopOnAbp.Shared.Hosting.AspNetCore; |
using EShopOnAbp.Shared.Hosting.AspNetCore; |
||||
using Microsoft.AspNetCore.Hosting; |
|
||||
using Microsoft.Extensions.Configuration; |
|
||||
using Microsoft.Extensions.Hosting; |
|
||||
using Serilog; |
using Serilog; |
||||
using System; |
using System; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Builder; |
||||
|
|
||||
namespace EShopOnAbp.WebPublicGateway |
namespace EShopOnAbp.WebPublicGateway; |
||||
|
|
||||
|
public class Program |
||||
{ |
{ |
||||
public class Program |
public static async Task<int> Main(string[] args) |
||||
{ |
{ |
||||
public static async Task<int> Main(string[] args) |
var assemblyName = typeof(Program).Assembly.GetName().Name; |
||||
{ |
|
||||
var assemblyName = typeof(Program).Assembly.GetName().Name; |
|
||||
|
|
||||
SerilogConfigurationHelper.Configure(assemblyName); |
SerilogConfigurationHelper.Configure(assemblyName); |
||||
|
|
||||
try |
try |
||||
{ |
{ |
||||
Log.Information($"Starting {assemblyName}."); |
Log.Information($"Starting {assemblyName}."); |
||||
await CreateHostBuilder(args).Build().RunAsync(); |
var app = await ApplicationBuilderHelper.BuildApplicationAsync<EShopOnAbpWebPublicGatewayModule>(args); |
||||
return 0; |
await app.InitializeApplicationAsync(); |
||||
} |
await app.RunAsync(); |
||||
catch (Exception ex) |
|
||||
{ |
|
||||
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); |
|
||||
return 1; |
|
||||
} |
|
||||
finally |
|
||||
{ |
|
||||
Log.CloseAndFlush(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
internal static IHostBuilder CreateHostBuilder(string[] args) => |
return 0; |
||||
Host.CreateDefaultBuilder(args) |
} |
||||
.ConfigureAppConfiguration(build => |
catch (Exception ex) |
||||
{ |
{ |
||||
build.AddJsonFile("appsettings.secrets.json", optional: true, reloadOnChange:true); |
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); |
||||
}) |
return 1; |
||||
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }) |
} |
||||
.UseAutofac() |
finally |
||||
.UseSerilog(); |
{ |
||||
|
Log.CloseAndFlush(); |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
@ -1,18 +0,0 @@ |
|||||
using Microsoft.AspNetCore.Builder; |
|
||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
|
|
||||
namespace EShopOnAbp.WebPublicGateway |
|
||||
{ |
|
||||
public class Startup |
|
||||
{ |
|
||||
public void ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
services.AddApplication<EShopOnAbpWebPublicGatewayModule>(); |
|
||||
} |
|
||||
|
|
||||
public void Configure(IApplicationBuilder app) |
|
||||
{ |
|
||||
app.InitializeApplication(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,46 +1,36 @@ |
|||||
using EShopOnAbp.Shared.Hosting.AspNetCore; |
using EShopOnAbp.Shared.Hosting.AspNetCore; |
||||
using Microsoft.AspNetCore.Hosting; |
|
||||
using Microsoft.Extensions.Configuration; |
|
||||
using Microsoft.Extensions.Hosting; |
|
||||
using Serilog; |
using Serilog; |
||||
using System; |
using System; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Builder; |
||||
|
|
||||
namespace EShopOnAbp.WebGateway |
namespace EShopOnAbp.WebGateway; |
||||
|
|
||||
|
public class Program |
||||
{ |
{ |
||||
public class Program |
public static async Task<int> Main(string[] args) |
||||
{ |
{ |
||||
public static async Task<int> Main(string[] args) |
var assemblyName = typeof(Program).Assembly.GetName().Name; |
||||
{ |
|
||||
var assemblyName = typeof(Program).Assembly.GetName().Name; |
|
||||
|
|
||||
SerilogConfigurationHelper.Configure(assemblyName); |
SerilogConfigurationHelper.Configure(assemblyName); |
||||
|
|
||||
try |
try |
||||
{ |
{ |
||||
Log.Information($"Starting {assemblyName}."); |
Log.Information($"Starting {assemblyName}."); |
||||
await CreateHostBuilder(args).Build().RunAsync(); |
var app = await ApplicationBuilderHelper.BuildApplicationAsync<EShopOnAbpWebGatewayModule>(args); |
||||
return 0; |
await app.InitializeApplicationAsync(); |
||||
} |
await app.RunAsync(); |
||||
catch (Exception ex) |
|
||||
{ |
|
||||
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); |
|
||||
return 1; |
|
||||
} |
|
||||
finally |
|
||||
{ |
|
||||
Log.CloseAndFlush(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
internal static IHostBuilder CreateHostBuilder(string[] args) => |
return 0; |
||||
Host.CreateDefaultBuilder(args) |
} |
||||
.ConfigureAppConfiguration(build => |
catch (Exception ex) |
||||
{ |
{ |
||||
build.AddJsonFile("appsettings.secrets.json", optional: true); |
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); |
||||
}) |
return 1; |
||||
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }) |
} |
||||
.UseAutofac() |
finally |
||||
.UseSerilog(); |
{ |
||||
|
Log.CloseAndFlush(); |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
@ -1,19 +0,0 @@ |
|||||
using Microsoft.AspNetCore.Builder; |
|
||||
using Microsoft.AspNetCore.Hosting; |
|
||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
|
|
||||
namespace EShopOnAbp.WebGateway |
|
||||
{ |
|
||||
public class Startup |
|
||||
{ |
|
||||
public void ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
services.AddApplication<EShopOnAbpWebGatewayModule>(); |
|
||||
} |
|
||||
|
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) |
|
||||
{ |
|
||||
app.InitializeApplication(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,46 +1,37 @@ |
|||||
using EShopOnAbp.Shared.Hosting.AspNetCore; |
using EShopOnAbp.Shared.Hosting.AspNetCore; |
||||
using Microsoft.AspNetCore.Hosting; |
|
||||
using Microsoft.Extensions.Configuration; |
|
||||
using Microsoft.Extensions.Hosting; |
|
||||
using Serilog; |
using Serilog; |
||||
using System; |
using System; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Builder; |
||||
|
|
||||
namespace EShopOnAbp.AdministrationService |
namespace EShopOnAbp.AdministrationService; |
||||
|
|
||||
|
public class Program |
||||
{ |
{ |
||||
public class Program |
public static async Task<int> Main(string[] args) |
||||
{ |
{ |
||||
public static async Task<int> Main(string[] args) |
var assemblyName = typeof(Program).Assembly.GetName().Name; |
||||
{ |
|
||||
var assemblyName = typeof(Program).Assembly.GetName().Name; |
|
||||
|
|
||||
SerilogConfigurationHelper.Configure(assemblyName); |
SerilogConfigurationHelper.Configure(assemblyName); |
||||
|
|
||||
try |
try |
||||
{ |
{ |
||||
Log.Information($"Starting {assemblyName}."); |
Log.Information($"Starting {assemblyName}."); |
||||
await CreateHostBuilder(args).Build().RunAsync(); |
var app = await ApplicationBuilderHelper |
||||
return 0; |
.BuildApplicationAsync<AdministrationServiceHttpApiHostModule>(args); |
||||
} |
await app.InitializeApplicationAsync(); |
||||
catch (Exception ex) |
await app.RunAsync(); |
||||
{ |
|
||||
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); |
|
||||
return 1; |
|
||||
} |
|
||||
finally |
|
||||
{ |
|
||||
Log.CloseAndFlush(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
internal static IHostBuilder CreateHostBuilder(string[] args) => |
return 0; |
||||
Host.CreateDefaultBuilder(args) |
} |
||||
.ConfigureAppConfiguration(build => |
catch (Exception ex) |
||||
{ |
{ |
||||
build.AddJsonFile("appsettings.secrets.json", optional: true); |
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); |
||||
}) |
return 1; |
||||
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }) |
} |
||||
.UseAutofac() |
finally |
||||
.UseSerilog(); |
{ |
||||
|
Log.CloseAndFlush(); |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
@ -1,18 +0,0 @@ |
|||||
using Microsoft.AspNetCore.Builder; |
|
||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
|
|
||||
namespace EShopOnAbp.AdministrationService |
|
||||
{ |
|
||||
public class Startup |
|
||||
{ |
|
||||
public void ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
services.AddApplication<AdministrationServiceHttpApiHostModule>(); |
|
||||
} |
|
||||
|
|
||||
public void Configure(IApplicationBuilder app) |
|
||||
{ |
|
||||
app.InitializeApplication(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,56 +1,37 @@ |
|||||
using System; |
using System; |
||||
using Microsoft.AspNetCore.Hosting; |
using System.Threading.Tasks; |
||||
using Microsoft.Extensions.Configuration; |
using EShopOnAbp.Shared.Hosting.AspNetCore; |
||||
using Microsoft.Extensions.Hosting; |
using Microsoft.AspNetCore.Builder; |
||||
using Serilog; |
using Serilog; |
||||
using Serilog.Events; |
|
||||
|
|
||||
namespace EShopOnAbp.BasketService |
namespace EShopOnAbp.BasketService; |
||||
|
|
||||
|
public class Program |
||||
{ |
{ |
||||
public class Program |
public static async Task<int> Main(string[] args) |
||||
{ |
{ |
||||
public static int Main(string[] args) |
var assemblyName = typeof(Program).Assembly.GetName().Name; |
||||
|
|
||||
|
SerilogConfigurationHelper.Configure(assemblyName); |
||||
|
|
||||
|
try |
||||
{ |
{ |
||||
Log.Logger = new LoggerConfiguration() |
Log.Information($"Starting {assemblyName}."); |
||||
#if DEBUG
|
var app = await ApplicationBuilderHelper |
||||
.MinimumLevel.Debug() |
.BuildApplicationAsync<BasketServiceHttpApiHostModule>(args); |
||||
#else
|
await app.InitializeApplicationAsync(); |
||||
.MinimumLevel.Information() |
await app.RunAsync(); |
||||
#endif
|
|
||||
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
||||
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) |
|
||||
.Enrich.FromLogContext() |
|
||||
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
||||
#if DEBUG
|
|
||||
.WriteTo.Async(c => c.Console()) |
|
||||
#endif
|
|
||||
.CreateLogger(); |
|
||||
|
|
||||
try |
return 0; |
||||
{ |
} |
||||
Log.Information("Starting EShopOnAbp.BasketService.HttpApi.Host."); |
catch (Exception ex) |
||||
CreateHostBuilder(args).Build().Run(); |
{ |
||||
return 0; |
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); |
||||
} |
return 1; |
||||
catch (Exception ex) |
} |
||||
{ |
finally |
||||
Log.Fatal(ex, "Host terminated unexpectedly!"); |
{ |
||||
return 1; |
Log.CloseAndFlush(); |
||||
} |
|
||||
finally |
|
||||
{ |
|
||||
Log.CloseAndFlush(); |
|
||||
} |
|
||||
} |
} |
||||
|
|
||||
internal static IHostBuilder CreateHostBuilder(string[] args) => |
|
||||
Host.CreateDefaultBuilder(args) |
|
||||
.AddAppSettingsSecretsJson() |
|
||||
.ConfigureWebHostDefaults(webBuilder => |
|
||||
{ |
|
||||
webBuilder.UseStartup<Startup>(); |
|
||||
}) |
|
||||
.UseAutofac() |
|
||||
.UseSerilog(); |
|
||||
} |
} |
||||
} |
} |
||||
@ -1,20 +0,0 @@ |
|||||
using Microsoft.AspNetCore.Builder; |
|
||||
using Microsoft.AspNetCore.Hosting; |
|
||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
using Microsoft.Extensions.Logging; |
|
||||
|
|
||||
namespace EShopOnAbp.BasketService |
|
||||
{ |
|
||||
public class Startup |
|
||||
{ |
|
||||
public void ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
services.AddApplication<BasketServiceHttpApiHostModule>(); |
|
||||
} |
|
||||
|
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) |
|
||||
{ |
|
||||
app.InitializeApplication(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,56 +1,37 @@ |
|||||
using System; |
using System; |
||||
using Microsoft.AspNetCore.Hosting; |
using System.Threading.Tasks; |
||||
using Microsoft.Extensions.Configuration; |
using EShopOnAbp.Shared.Hosting.AspNetCore; |
||||
using Microsoft.Extensions.Hosting; |
using Microsoft.AspNetCore.Builder; |
||||
using Serilog; |
using Serilog; |
||||
using Serilog.Events; |
|
||||
|
|
||||
namespace EShopOnAbp.CatalogService |
namespace EShopOnAbp.CatalogService; |
||||
|
|
||||
|
public class Program |
||||
{ |
{ |
||||
public class Program |
public static async Task<int> Main(string[] args) |
||||
{ |
{ |
||||
public static int Main(string[] args) |
var assemblyName = typeof(Program).Assembly.GetName().Name; |
||||
|
|
||||
|
SerilogConfigurationHelper.Configure(assemblyName); |
||||
|
|
||||
|
try |
||||
{ |
{ |
||||
Log.Logger = new LoggerConfiguration() |
Log.Information($"Starting {assemblyName}."); |
||||
#if DEBUG
|
var app = await ApplicationBuilderHelper |
||||
.MinimumLevel.Debug() |
.BuildApplicationAsync<CatalogServiceHttpApiHostModule>(args); |
||||
#else
|
await app.InitializeApplicationAsync(); |
||||
.MinimumLevel.Information() |
await app.RunAsync(); |
||||
#endif
|
|
||||
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
||||
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) |
|
||||
.Enrich.FromLogContext() |
|
||||
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
||||
#if DEBUG
|
|
||||
.WriteTo.Async(c => c.Console()) |
|
||||
#endif
|
|
||||
.CreateLogger(); |
|
||||
|
|
||||
try |
return 0; |
||||
{ |
} |
||||
Log.Information("Starting EShopOnAbp.CatalogService.HttpApi.Host."); |
catch (Exception ex) |
||||
CreateHostBuilder(args).Build().Run(); |
{ |
||||
return 0; |
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); |
||||
} |
return 1; |
||||
catch (Exception ex) |
} |
||||
{ |
finally |
||||
Log.Fatal(ex, "Host terminated unexpectedly!"); |
{ |
||||
return 1; |
Log.CloseAndFlush(); |
||||
} |
|
||||
finally |
|
||||
{ |
|
||||
Log.CloseAndFlush(); |
|
||||
} |
|
||||
} |
} |
||||
|
|
||||
internal static IHostBuilder CreateHostBuilder(string[] args) => |
|
||||
Host.CreateDefaultBuilder(args) |
|
||||
.AddAppSettingsSecretsJson() |
|
||||
.ConfigureWebHostDefaults(webBuilder => |
|
||||
{ |
|
||||
webBuilder.UseStartup<Startup>(); |
|
||||
}) |
|
||||
.UseAutofac() |
|
||||
.UseSerilog(); |
|
||||
} |
} |
||||
} |
} |
||||
@ -1,20 +0,0 @@ |
|||||
using Microsoft.AspNetCore.Builder; |
|
||||
using Microsoft.AspNetCore.Hosting; |
|
||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
using Microsoft.Extensions.Logging; |
|
||||
|
|
||||
namespace EShopOnAbp.CatalogService |
|
||||
{ |
|
||||
public class Startup |
|
||||
{ |
|
||||
public void ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
services.AddApplication<CatalogServiceHttpApiHostModule>(); |
|
||||
} |
|
||||
|
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) |
|
||||
{ |
|
||||
app.InitializeApplication(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,46 +1,37 @@ |
|||||
using EShopOnAbp.Shared.Hosting.AspNetCore; |
using EShopOnAbp.Shared.Hosting.AspNetCore; |
||||
using Microsoft.AspNetCore.Hosting; |
|
||||
using Microsoft.Extensions.Configuration; |
|
||||
using Microsoft.Extensions.Hosting; |
|
||||
using Serilog; |
using Serilog; |
||||
using System; |
using System; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Builder; |
||||
|
|
||||
namespace EShopOnAbp.IdentityService |
namespace EShopOnAbp.IdentityService; |
||||
|
|
||||
|
public class Program |
||||
{ |
{ |
||||
public class Program |
public static async Task<int> Main(string[] args) |
||||
{ |
{ |
||||
public static async Task<int> Main(string[] args) |
var assemblyName = typeof(Program).Assembly.GetName().Name; |
||||
{ |
|
||||
var assemblyName = typeof(Program).Assembly.GetName().Name; |
|
||||
|
|
||||
SerilogConfigurationHelper.Configure(assemblyName); |
SerilogConfigurationHelper.Configure(assemblyName); |
||||
|
|
||||
try |
try |
||||
{ |
{ |
||||
Log.Information($"Starting {assemblyName}."); |
Log.Information($"Starting {assemblyName}."); |
||||
await CreateHostBuilder(args).Build().RunAsync(); |
var app = await ApplicationBuilderHelper |
||||
return 0; |
.BuildApplicationAsync<IdentityServiceHttpApiHostModule>(args); |
||||
} |
await app.InitializeApplicationAsync(); |
||||
catch (Exception ex) |
await app.RunAsync(); |
||||
{ |
|
||||
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); |
|
||||
return 1; |
|
||||
} |
|
||||
finally |
|
||||
{ |
|
||||
Log.CloseAndFlush(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
internal static IHostBuilder CreateHostBuilder(string[] args) => |
return 0; |
||||
Host.CreateDefaultBuilder(args) |
} |
||||
.ConfigureAppConfiguration(build => |
catch (Exception ex) |
||||
{ |
{ |
||||
build.AddJsonFile("appsettings.secrets.json", optional: true); |
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); |
||||
}) |
return 1; |
||||
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }) |
} |
||||
.UseAutofac() |
finally |
||||
.UseSerilog(); |
{ |
||||
|
Log.CloseAndFlush(); |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
@ -1,18 +0,0 @@ |
|||||
using Microsoft.AspNetCore.Builder; |
|
||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
|
|
||||
namespace EShopOnAbp.IdentityService |
|
||||
{ |
|
||||
public class Startup |
|
||||
{ |
|
||||
public void ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
services.AddApplication<IdentityServiceHttpApiHostModule>(); |
|
||||
} |
|
||||
|
|
||||
public void Configure(IApplicationBuilder app) |
|
||||
{ |
|
||||
app.InitializeApplication(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,56 +1,37 @@ |
|||||
using System; |
using System; |
||||
using System.IO; |
using System.Threading.Tasks; |
||||
using Microsoft.AspNetCore.Hosting; |
using EShopOnAbp.Shared.Hosting.AspNetCore; |
||||
using Microsoft.Extensions.Configuration; |
using Microsoft.AspNetCore.Builder; |
||||
using Microsoft.Extensions.Hosting; |
|
||||
using Serilog; |
using Serilog; |
||||
using Serilog.Events; |
|
||||
|
|
||||
namespace EShopOnAbp.OrderingService |
namespace EShopOnAbp.OrderingService; |
||||
|
|
||||
|
public class Program |
||||
{ |
{ |
||||
public class Program |
public static async Task<int> Main(string[] args) |
||||
{ |
{ |
||||
public static int Main(string[] args) |
var assemblyName = typeof(Program).Assembly.GetName().Name; |
||||
|
|
||||
|
SerilogConfigurationHelper.Configure(assemblyName); |
||||
|
|
||||
|
try |
||||
{ |
{ |
||||
Log.Logger = new LoggerConfiguration() |
Log.Information($"Starting {assemblyName}."); |
||||
#if DEBUG
|
var app = await ApplicationBuilderHelper |
||||
.MinimumLevel.Debug() |
.BuildApplicationAsync<OrderingServiceHttpApiHostModule>(args); |
||||
#else
|
await app.InitializeApplicationAsync(); |
||||
.MinimumLevel.Information() |
await app.RunAsync(); |
||||
#endif
|
|
||||
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
||||
.Enrich.FromLogContext() |
|
||||
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
||||
#if DEBUG
|
|
||||
.WriteTo.Async(c => c.Console()) |
|
||||
#endif
|
|
||||
.CreateLogger(); |
|
||||
|
|
||||
try |
return 0; |
||||
{ |
} |
||||
Log.Information("Starting web host."); |
catch (Exception ex) |
||||
CreateHostBuilder(args).Build().Run(); |
{ |
||||
return 0; |
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); |
||||
} |
return 1; |
||||
catch (Exception ex) |
} |
||||
{ |
finally |
||||
Log.Fatal(ex, "Host terminated unexpectedly!"); |
{ |
||||
return 1; |
Log.CloseAndFlush(); |
||||
} |
|
||||
finally |
|
||||
{ |
|
||||
Log.CloseAndFlush(); |
|
||||
} |
|
||||
} |
} |
||||
|
|
||||
internal static IHostBuilder CreateHostBuilder(string[] args) => |
|
||||
Host.CreateDefaultBuilder(args) |
|
||||
.AddAppSettingsSecretsJson() |
|
||||
.ConfigureWebHostDefaults(webBuilder => |
|
||||
{ |
|
||||
webBuilder.UseStartup<Startup>(); |
|
||||
}) |
|
||||
.UseAutofac() |
|
||||
.UseSerilog(); |
|
||||
} |
} |
||||
} |
} |
||||
@ -1,20 +0,0 @@ |
|||||
using Microsoft.AspNetCore.Builder; |
|
||||
using Microsoft.AspNetCore.Hosting; |
|
||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
using Microsoft.Extensions.Logging; |
|
||||
|
|
||||
namespace EShopOnAbp.OrderingService |
|
||||
{ |
|
||||
public class Startup |
|
||||
{ |
|
||||
public void ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
services.AddApplication<OrderingServiceHttpApiHostModule>(); |
|
||||
} |
|
||||
|
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) |
|
||||
{ |
|
||||
app.InitializeApplication(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,56 +1,37 @@ |
|||||
using System; |
using System; |
||||
using System.IO; |
using System.Threading.Tasks; |
||||
using Microsoft.AspNetCore.Hosting; |
using EShopOnAbp.Shared.Hosting.AspNetCore; |
||||
using Microsoft.Extensions.Configuration; |
using Microsoft.AspNetCore.Builder; |
||||
using Microsoft.Extensions.Hosting; |
|
||||
using Serilog; |
using Serilog; |
||||
using Serilog.Events; |
|
||||
|
|
||||
namespace EShopOnAbp.PaymentService |
namespace EShopOnAbp.PaymentService; |
||||
|
|
||||
|
public class Program |
||||
{ |
{ |
||||
public class Program |
public static async Task<int> Main(string[] args) |
||||
{ |
{ |
||||
public static int Main(string[] args) |
var assemblyName = typeof(Program).Assembly.GetName().Name; |
||||
|
|
||||
|
SerilogConfigurationHelper.Configure(assemblyName); |
||||
|
|
||||
|
try |
||||
{ |
{ |
||||
Log.Logger = new LoggerConfiguration() |
Log.Information($"Starting {assemblyName}."); |
||||
#if DEBUG
|
var app = await ApplicationBuilderHelper |
||||
.MinimumLevel.Debug() |
.BuildApplicationAsync<PaymentServiceHttpApiHostModule>(args); |
||||
#else
|
await app.InitializeApplicationAsync(); |
||||
.MinimumLevel.Information() |
await app.RunAsync(); |
||||
#endif
|
|
||||
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
||||
.Enrich.FromLogContext() |
|
||||
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
||||
#if DEBUG
|
|
||||
.WriteTo.Async(c => c.Console()) |
|
||||
#endif
|
|
||||
.CreateLogger(); |
|
||||
|
|
||||
try |
return 0; |
||||
{ |
} |
||||
Log.Information("Starting web host."); |
catch (Exception ex) |
||||
CreateHostBuilder(args).Build().Run(); |
{ |
||||
return 0; |
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); |
||||
} |
return 1; |
||||
catch (Exception ex) |
} |
||||
{ |
finally |
||||
Log.Fatal(ex, "Host terminated unexpectedly!"); |
{ |
||||
return 1; |
Log.CloseAndFlush(); |
||||
} |
|
||||
finally |
|
||||
{ |
|
||||
Log.CloseAndFlush(); |
|
||||
} |
|
||||
} |
} |
||||
|
|
||||
internal static IHostBuilder CreateHostBuilder(string[] args) => |
|
||||
Host.CreateDefaultBuilder(args) |
|
||||
.AddAppSettingsSecretsJson() |
|
||||
.ConfigureWebHostDefaults(webBuilder => |
|
||||
{ |
|
||||
webBuilder.UseStartup<Startup>(); |
|
||||
}) |
|
||||
.UseAutofac() |
|
||||
.UseSerilog(); |
|
||||
} |
} |
||||
} |
} |
||||
@ -1,21 +0,0 @@ |
|||||
using System; |
|
||||
using Microsoft.AspNetCore.Builder; |
|
||||
using Microsoft.AspNetCore.Hosting; |
|
||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
using Microsoft.Extensions.Logging; |
|
||||
|
|
||||
namespace EShopOnAbp.PaymentService |
|
||||
{ |
|
||||
public class Startup |
|
||||
{ |
|
||||
public void ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
services.AddApplication<PaymentServiceHttpApiHostModule>(); |
|
||||
} |
|
||||
|
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) |
|
||||
{ |
|
||||
app.InitializeApplication(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue