public static ILoggerFactory AddADSLogger(this ILoggerFactory loggerFactory , IApplicationBuilder app) { var config = new ADSUtilitiesLoggerConfiguration(); return(loggerFactory.AddADSLogger(config, app)); }
/// <summary> /// /// </summary> /// <param name="app"></param> /// <param name="env"></param> /// <param name="loggerFactory"></param> // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { var cultureInfo = new CultureInfo("ec-EC"); cultureInfo.NumberFormat.CurrencySymbol = "$"; cultureInfo.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy"; CultureInfo.DefaultThreadCurrentCulture = cultureInfo; CultureInfo.DefaultThreadCurrentUICulture = cultureInfo; app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint(SwaggerConfiguration.EndpointUrl, SwaggerConfiguration.EndpointDescription); }); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } loggerFactory.AddADSLogger(c => { c.LogLevel = LogLevel.Information; c.Service = Configuration.GetSection("ServiceId").Value; }, app); ResponseMessages.BAD_REQUEST = Configuration.GetSection("Global:Messages:BadRequest").Value; ResponseMessages.NOT_FOUND = Configuration.GetSection("Global:Messages:NotFound").Value; ResponseMessages.INTERNAL_ERROR = Configuration.GetSection("Global:Messages:InternalError").Value; ResponseMessages.OK = Configuration.GetSection("Global:Messages:Ok").Value; app.UseADSConfiguration(); app.UseMvc(); }
// This method gets called by the runtime. Use this method to add services to the container. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. /// <summary> /// / /// </summary> /// <param name="app"></param> /// <param name="env"></param> /// <param name="loggerFactory"></param> public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { var cultureInfo = new CultureInfo("ec-EC"); cultureInfo.NumberFormat.CurrencySymbol = "$"; cultureInfo.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy"; CultureInfo.DefaultThreadCurrentCulture = cultureInfo; CultureInfo.DefaultThreadCurrentUICulture = cultureInfo; loggerFactory.AddADSLogger(c => { c.LogLevel = LogLevel.Information; c.Service = Configuration.GetSection("ServiceId").Value; }, app); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint(SwaggerConfiguration.EndpointUrl, SwaggerConfiguration.EndpointDescription); }); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseHttpsRedirection(); app.UseADSConfiguration(); app.UseMvc(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env , ILoggerFactory loggerFactory) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseHsts(); } loggerFactory.AddADSLogger(c => { c.LogLevel = LogLevel.Warning; c.Service = Configuration.GetSection("ServiceId").Value; }); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint( Configuration.GetSection("Swagger:EndpointUrl").Value, Configuration.GetSection("Swagger:EndpointDescription").Value); }); app.UseHttpsRedirection(); app.UseADSConfiguration(); app.UseMvc(); }
public static ILoggerFactory AddADSLogger(this ILoggerFactory loggerFactory, Action <ADSUtilitiesLoggerConfiguration> configure) { var config = new ADSUtilitiesLoggerConfiguration(); configure(config); return(loggerFactory.AddADSLogger(config)); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env , ILoggerFactory loggerFactory) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } loggerFactory.AddADSLogger(c => { c.LogLevel = LogLevel.Warning; }); app.UseMvc(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env , ILoggerFactory loggerFactory) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } loggerFactory.AddADSLogger(c => { c.LogLevel = LogLevel.Warning; c.Service = Configuration.GetSection("ServiceId").Value; }, app); app.UseMvc(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddADSLogger(c => { c.LogLevel = LogLevel.Warning; }, app); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint(SwaggerConfiguration.EndpointUrl, SwaggerConfiguration.EndpointDescription); }); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseHttpsRedirection(); app.UseADSConfiguration(); app.UseMvc(); }