예제 #1
0
 static Metric()
 {
     globalContext = new DefaultMetricsContext(GetGlobalContextName());
     if (MetricsConfig.GloballyDisabledMetrics)
     {
         globalContext.CompletelyDisableMetrics();
         log.Info(() => "Metrics: Metrics.NET Library is completely disabled. Set Metrics.CompletelyDisableMetrics to false to re-enable.");
     }
     config = new MetricsConfig(globalContext);
     config.ApplySettingsFromConfigFile();
 }
예제 #2
0
 static Metric()
 {
     globalContext = new DefaultMetricsContext(GetGlobalContextName());
     if (MetricsConfig.GlobalyDisabledMetrics)
     {
         globalContext.CompletelyDisableMetrics();
         log.Info(() => "Metrics: Metrics.NET Library is completely disabled. Set Metrics.CompetelyDisableMetrics to false to re-enable.");
     }
     config = new MetricsConfig(globalContext);
     config.ApplySettingsFromConfigFile();
 }
예제 #3
0
 private static MetricsConfig InitConfig(string context)
 {
     globalContext = new DefaultMetricsContext(context);
     if (MetricsConfig.GloballyDisabledMetrics)
     {
         globalContext.CompletelyDisableMetrics();
         log.Info(() => "Metrics: Metrics.NET Library is completely disabled. Set Metrics.CompletelyDisableMetrics to false to re-enable.");
     }
     config = new MetricsConfig(globalContext);
     config.ApplySettingsFromConfigFile();
     return(config);
 }
예제 #4
0
 static Metric()
 {
     ConfigurationManager.Build(builder =>
     {
         builder.AddJsonFile("appsettings.json", true, true)
         .AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", true, true)
         .Build();
     });
     globalContext = new DefaultMetricsContext(GetGlobalContextName());
     if (MetricsConfig.GloballyDisabledMetrics)
     {
         globalContext.CompletelyDisableMetrics();
         log.Info(() => "Metrics: Metrics.NET Library is completely disabled. Set Metrics.CompletelyDisableMetrics to false to re-enable.");
     }
     config = new MetricsConfig(globalContext);
     config.ApplySettingsFromConfigFile();
 }
예제 #5
0
 static Metric()
 {
     globalContext = new DefaultMetricsContext(MetricsConfig.GetGlobalContextName());
     config        = new MetricsConfig(globalContext);
     config.ApplySettingsFromConfigFile();
 }