Setting up Serilog
- Serilog Aspnetcore
- Two Stage Initialization
- Serilog Settings Configurations
- Serilog Sinks
- Console
- File
- Seq
Setting up Seq
docker pull datalust/seq
docker run --name seq -d --restart unless-stopped -e ACCEPT_EULA=Y -p 5341:80 datalust/seq:latest
Configurations - Options pattern in ASP.NET Core
Configuration -> GetSection -> Bind
var localAppSettings = new AppSettings();
_configuration.GetSection(AppSettings.Key).Bind(localAppSettings);
Configuration -> Get Section - Get
var localAppSettings = _configuration.GetSection(AppSettings.Key).Get<AppSettings>();
Services -> Configure
services.Configure<AppSettings>(Configuration.GetSection(AppSettings.Key));
Service -> AddOptions -> Bind
services.AddOptions<TokenSettings>().Bind(Configuration.GetSection(TokenSettings.Key));