Posts

Showing posts with the label development

Remove redirection of localhost to HTTPS

Remove redirection of localhost to HTTPS Symptoms Chrome redirects http://localhost to https://localhost On guest mode, http://localhost is accessible Curl can retrieve http://localhost Cause One of my test project was configuring SSL on nginx. The configuration was redirecting localhost to https for testing purposes and Chrome had since then cached the redirection. Subsequent calls were no longer hitting nginx as they were only hitting Chrome cache. Fix Open the Web Developer Console on Chrome, CTRL+SHIFT+I Right click on the reload arrow Select Empty Cache And Hard Reload This will remove all cached items including the redirection. http://localhost will no longer be redirected by Chrome.

Multi environment logging with Serilog for AspNet Core

Multi environment logging with Serilog for AspNet Core Few months ago we saw how to get started with Serilog. We discovered what was Serilog and the different concepts of settings, enrichers and sinks. Today we will see how we can take Serilog further and configure a logging mechanism for an application running in multi environment. Setup Serilog Multi environment AWS CloudWatch 1. Setup Serilog If you have never seen Serilog before you can start with my previous post on How to get started with Serilog . In order to configure our first logging mechanism, we start by creating an AspNet Core application and install Serilog , Serilog.AspNetCore and the sinks we will be using Serilog.Sinks.Console , Serilog.Sinks.File . RollingFile sink also exists but it has been superseded with File sink. Next we can configure the logger to write to Console and write to a file: public static IWebHost BuildWebHost(string[] args) { return WebHost.CreateDefaultBuilder(args) ...