Esempio n. 1
0
        public static ILoggerFactory AddAppInsights(
            this ILoggerFactory factory,
            AppInsightsOptions options)
        {
            factory.AddProvider(new AppInsightsLogProvider(null, options));

            return(factory);
        }
Esempio n. 2
0
 public static ILoggerFactory AddAppInsights(
     this ILoggerFactory factory,
     Func <string, LogLevel, bool> filter,
     AppInsightsOptions options)
 {
     factory.AddProvider(new AppInsightsLogProvider(filter, options));
     return(factory);
 }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
 public AppInsightsLogProvider(AppInsightsOptions configOptions)
     : this(null, configOptions)
 {
 }
Esempio n. 5
0
 public AppInsightsLogProvider(Func <string, LogLevel, bool> filter, AppInsightsOptions configOptions)
 {
     this.filter = filter;
     options     = configOptions;
 }
Esempio n. 6
0
 public AppInsightsLogger(Func <string, LogLevel, bool> filter, AppInsightsOptions configOptions)
     : this(null, filter, configOptions)
 {
 }
Esempio n. 7
0
 public AppInsightsLogger(string name, AppInsightsOptions configOptions)
     : this(name, null, configOptions)
 {
 }