Пример #1
0
 private static void TryConfigureFileLogging(IConfiguration configuration, IServiceCollection services, string name)
 {
     bool.TryParse(configuration[nameof(TestClusterOptions.ConfigureFileLogging)], out bool configureFileLogging);
     if (configureFileLogging)
     {
         var fileName = TestingUtils.CreateTraceFileName(name, configuration[nameof(TestClusterOptions.ClusterId)]);
         services.AddLogging(loggingBuilder => loggingBuilder.AddFile(fileName));
     }
 }
Пример #2
0
        public ISiloHostBuilder CreateSiloBuilder(string siloName, ClusterConfiguration clusterConfiguration)
        {
            var builder = new SiloHostBuilder();

            return(builder.ConfigureSiloName(siloName)
                   .ConfigureApplicationParts(parts => parts.AddFromAppDomain())
                   .UseConfiguration(clusterConfiguration)
                   .ConfigureLogging(loggingBuilder => TestingUtils.ConfigureDefaultLoggingBuilder(loggingBuilder,
                                                                                                   TestingUtils.CreateTraceFileName(siloName, clusterConfiguration.Globals.ClusterId))));
        }