1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-15 02:13:01 +00:00

Updated example

This commit is contained in:
Jkorf
2022-01-03 14:08:35 +01:00
parent ebe332b724
commit 6b45859934
7 changed files with 51 additions and 36 deletions
+12 -1
View File
@@ -1,5 +1,8 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Serilog;
using Serilog.Events;
namespace BlazorClient
{
@@ -7,6 +10,13 @@ namespace BlazorClient
{
public static void Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.MinimumLevel.Override("Microsoft.AspNetCore.Mvc", LogEventLevel.Error)
.WriteTo.File("log-.txt", rollingInterval: RollingInterval.Day, flushToDiskInterval: System.TimeSpan.FromSeconds(1))
.CreateLogger();
CreateHostBuilder(args).Build().Run();
}
@@ -14,7 +24,8 @@ namespace BlazorClient
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
webBuilder.UseStartup(
context => new Startup(context.Configuration, LoggerFactory.Create(config => config.AddSerilog()) ));
});
}
}