Agradeceríamos tu ayuda para compartir nuestros artículos sobre las ciencias informáticas.
Ejemplo: configuración del servidor serilog-in-aspnetcore-3 sql
public class Program
public static IConfiguration Configuration get; = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json", optional: false, reloadOnChange: true).AddJsonFile($"appsettings.Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production".json", optional: true).Build();public static void Main(string[] args)
Log.Logger = new LoggerConfiguration().ReadFrom.Configuration(Configuration).CreateLogger();
try
Log.Information("Getting the motors running...");
BuildWebHost(args).Run();
catch (Exception ex)
Log.Fatal(ex,"Host terminated unexpectedly");
finally
Log.CloseAndFlush();
public static IWebHost BuildWebHost(string[] args)=>
WebHost.CreateDefaultBuilder(args).UseStartup<Startup>().UseConfiguration(Configuration).UseSerilog().Build();
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)