public static ILoggerFactory AddADSLogger(this ILoggerFactory loggerFactory
                                                  , IApplicationBuilder app)
        {
            var config = new ADSUtilitiesLoggerConfiguration();

            return(loggerFactory.AddADSLogger(config, app));
        }
Example #2
0
        /// <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();
        }
Example #3
0
        // 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();
        }
Example #4
0
        // 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();
        }
Example #5
0
        public static ILoggerFactory AddADSLogger(this ILoggerFactory loggerFactory,
                                                  Action <ADSUtilitiesLoggerConfiguration> configure)
        {
            var config = new ADSUtilitiesLoggerConfiguration();

            configure(config);
            return(loggerFactory.AddADSLogger(config));
        }
Example #6
0
        // 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();
        }
Example #7
0
        // 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();
        }
Example #8
0
        // 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();
        }