@@ -38,7 +38,22 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
3838 . ConfigureServices ( ( hostContext , services ) =>
3939 {
4040 IConfiguration configuration = hostContext . Configuration ;
41- services . AddScoped ( typeof ( UtilTelemetry ) ) ;
41+ ILoggerFactory loggerFactory =
42+ LoggerFactory . Create ( builder =>
43+ {
44+ builder . AddConfiguration ( configuration . GetSection ( "Logging" ) ) ;
45+ builder . AddSimpleConsole ( options =>
46+ {
47+ options . IncludeScopes = true ;
48+ options . SingleLine = true ;
49+ options . TimestampFormat = "yyyy-MM-dd HH:mm:ss " ;
50+ options . UseUtcTimestamp = true ;
51+ } ) ;
52+ } ) ;
53+
54+ services . AddSingleton ( loggerFactory ) ;
55+ AppContext . SetSwitch ( "Npgsql.EnableLegacyTimestampBehavior" , true ) ;
56+ services . AddScoped ( typeof ( UtilTelemetry ) ) ;
4257 services . AddScoped ( typeof ( Usuario ) ) ;
4358 services . AddScoped ( typeof ( UtilPeticion ) ) ;
4459
@@ -59,13 +74,12 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
5974 {
6075 bdType = configuration . GetConnectionString ( "connectionType" ) ;
6176 }
62- if ( bdType . Equals ( "2" ) )
77+ if ( bdType . Equals ( "2" ) || bdType . Equals ( "1" ) )
6378 {
6479 services . AddScoped ( typeof ( DbContextOptions < EntityContext > ) ) ;
6580 services . AddScoped ( typeof ( DbContextOptions < EntityContextBASE > ) ) ;
6681 }
6782 services . AddSingleton < ConfigService > ( ) ;
68- services . AddSingleton < ILoggerFactory , LoggerFactory > ( ) ;
6983
7084 string acid = "" ;
7185 if ( environmentVariables . Contains ( "acid" ) )
@@ -95,7 +109,17 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
95109
96110 ) ;
97111 }
98- else if ( bdType . Equals ( "2" ) )
112+ else if ( bdType . Equals ( "1" ) )
113+ {
114+ services . AddDbContext < EntityContext , EntityContextOracle > ( options =>
115+ options . UseOracle ( acid )
116+ ) ;
117+ services . AddDbContext < EntityContextBASE , EntityContextBASEOracle > ( options =>
118+ options . UseOracle ( baseConnection )
119+
120+ ) ;
121+ }
122+ else if ( bdType . Equals ( "2" ) )
99123 {
100124 services . AddDbContext < EntityContext , EntityContextPostgres > ( opt =>
101125 {
0 commit comments