11using System ;
2- using System . Collections . Generic ;
3- using System . Linq ;
42using System . Threading ;
53using System . Threading . Tasks ;
64using Microsoft . AspNetCore . Hosting ;
@@ -17,28 +15,29 @@ internal class Program : IDisposable
1715
1816 public static async Task < int > Main ( string [ ] args )
1917 {
20- using ( var program = new Program ( args ) )
18+ var configuration = new SqlStreamStoreServerConfiguration (
19+ Environment . GetEnvironmentVariables ( ) ,
20+ args ) ;
21+
22+ using ( var program = new Program ( configuration ) )
2123 {
2224 return await program . Run ( ) ;
2325 }
2426 }
2527
26- private Program ( string [ ] args )
28+ private Program ( SqlStreamStoreServerConfiguration configuration )
2729 {
28- _configuration = new SqlStreamStoreServerConfiguration (
29- Environment . GetEnvironmentVariables ( ) ,
30- args ) ;
31-
32- Console . WriteLine ( _configuration . ToString ( ) ) ;
33-
3430 Log . Logger = new LoggerConfiguration ( )
35- . MinimumLevel . Is ( _configuration . LogLevel )
31+ . MinimumLevel . Is ( configuration . LogLevel )
3632 . Enrich . FromLogContext ( )
3733 . WriteTo . Console ( )
3834 . CreateLogger ( ) ;
3935
36+ Log . Information ( configuration . ToString ( ) ) ;
37+
38+ _configuration = configuration ;
4039 _cts = new CancellationTokenSource ( ) ;
41- _factory = new SqlStreamStoreFactory ( _configuration ) ;
40+ _factory = new SqlStreamStoreFactory ( configuration ) ;
4241 }
4342
4443 private async Task < int > Run ( )
@@ -49,7 +48,8 @@ private async Task<int> Run()
4948 using ( var host = new WebHostBuilder ( )
5049 . SuppressStatusMessages ( true )
5150 . UseKestrel ( )
52- . UseStartup ( new SqlStreamStoreServerStartup ( streamStore ,
51+ . UseStartup ( new SqlStreamStoreServerStartup (
52+ streamStore ,
5353 new SqlStreamStoreMiddlewareOptions
5454 {
5555 UseCanonicalUrls = _configuration . UseCanonicalUris ,
0 commit comments