コード例 #1
0
        public static ILoggerFactory AddAppInsights(
            this ILoggerFactory factory,
            AppInsightsOptions options)
        {
            factory.AddProvider(new AppInsightsLogProvider(null, options));

            return(factory);
        }
コード例 #2
0
 public static ILoggerFactory AddAppInsights(
     this ILoggerFactory factory,
     Func <string, LogLevel, bool> filter,
     AppInsightsOptions options)
 {
     factory.AddProvider(new AppInsightsLogProvider(filter, options));
     return(factory);
 }
コード例 #3
0
ファイル: AppInsightsLogger.cs プロジェクト: lulzzz/piraeus-1
        public AppInsightsLogger(string name, Func <string, LogLevel, bool> filter, AppInsightsOptions configOptions)
        {
            this.name   = string.IsNullOrEmpty(name) ? "AppInsightsLogger" : name;
            this.filter = filter == null ? null : filter;
            _logLevel   = configOptions.LoggingLevel;

            TelemetryConfiguration.Active.TelemetryChannel.DeveloperMode = configOptions.DeveloperMode;
            TelemetryConfiguration.Active.InstrumentationKey             = configOptions.InstrumentationKey;

            client = new TelemetryClient();
            client.InstrumentationKey = configOptions.InstrumentationKey;
        }
コード例 #4
0
 public AppInsightsLogProvider(AppInsightsOptions configOptions)
     : this(null, configOptions)
 {
 }
コード例 #5
0
 public AppInsightsLogProvider(Func <string, LogLevel, bool> filter, AppInsightsOptions configOptions)
 {
     this.filter = filter;
     options     = configOptions;
 }
コード例 #6
0
ファイル: AppInsightsLogger.cs プロジェクト: lulzzz/piraeus-1
 public AppInsightsLogger(Func <string, LogLevel, bool> filter, AppInsightsOptions configOptions)
     : this(null, filter, configOptions)
 {
 }
コード例 #7
0
ファイル: AppInsightsLogger.cs プロジェクト: lulzzz/piraeus-1
 public AppInsightsLogger(string name, AppInsightsOptions configOptions)
     : this(name, null, configOptions)
 {
 }