forked from FarmMaps/FarmMapsApiClient
small naming fix
This commit is contained in:
parent
fefd348930
commit
1b6128f52a
@ -41,13 +41,13 @@ namespace FarmmapsApi
|
||||
.AddHttpClient<FarmmapsApiService>()
|
||||
.AddHttpMessageHandler<FarmmapsAuthenticationHandler>()
|
||||
.Services;
|
||||
|
||||
|
||||
Configure(serviceCollection);
|
||||
|
||||
var serviceProvider = serviceCollection.BuildServiceProvider();
|
||||
|
||||
ConfigureLogger(serviceProvider);
|
||||
|
||||
|
||||
await serviceProvider.GetService<FarmmapsApiService>().AuthenticateAsync();
|
||||
// await serviceProvider.GetService<FarmmapsEventHub>().StartEventHub();
|
||||
|
||||
@ -55,20 +55,20 @@ namespace FarmmapsApi
|
||||
}
|
||||
|
||||
protected abstract void Configure(IServiceCollection serviceCollection);
|
||||
|
||||
|
||||
private static void ConfigureLogger(IServiceProvider serviceProvider)
|
||||
{
|
||||
var isService = Matching.FromSource("Microsoft");
|
||||
|
||||
var isMicrosoftNamespace = Matching.FromSource("Microsoft");
|
||||
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.MinimumLevel.Information()
|
||||
.WriteTo.Logger(l => l.Filter.ByIncludingOnly(isService)
|
||||
.WriteTo.Logger(l => l.Filter.ByIncludingOnly(isMicrosoftNamespace)
|
||||
.WriteTo.Console(LogEventLevel.Warning))
|
||||
.WriteTo.File(path: "Logs/log.log", rollingInterval: RollingInterval.Day)
|
||||
.CreateLogger();
|
||||
|
||||
var loggerFactory = serviceProvider.GetRequiredService<ILoggerFactory>();
|
||||
loggerFactory.AddSerilog();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user