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

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