fix log variables de entorno
This commit is contained in:
parent
fee40a25a4
commit
ca6f3cec82
4 changed files with 33 additions and 4 deletions
|
@ -14,6 +14,16 @@ namespace Recuperacion_DGA
|
|||
{
|
||||
static async Task Main(string[] args)
|
||||
{
|
||||
IConfiguration configuration;
|
||||
|
||||
configuration = new ConfigurationBuilder()
|
||||
.SetBasePath(Directory.GetCurrentDirectory())
|
||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||
.AddEnvironmentVariables()
|
||||
.Build();
|
||||
|
||||
FileLoggerHelper.ConfigureLogger(configuration);
|
||||
|
||||
try
|
||||
{
|
||||
Console.WriteLine("Obteniendo variables de entorno...");
|
||||
|
@ -35,9 +45,7 @@ namespace Recuperacion_DGA
|
|||
using IHost host = Host.CreateDefaultBuilder(args)
|
||||
.ConfigureServices((context, services) =>
|
||||
{
|
||||
IConfiguration configuration = context.Configuration;
|
||||
services.AddSingleton<IConfiguration>(configuration);
|
||||
|
||||
services.AddScoped<MedicionScadaRepository>();
|
||||
services.AddScoped<EnvioDGA>();
|
||||
services.AddHttpClient<RegistrarMedicion>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue