/// <summary>
 /// </summary>
 /// <param name="categoryName"></param>
 /// <param name="options"></param>
 /// <param name="applicationName"></param>
 /// <param name="environment"></param>
 public BunyanLambdaILogger(string categoryName, LambdaLoggerOptions options, string applicationName, string environment = null)
     : this(categoryName, options)
 {
     this.applicationName = applicationName;
     this.environment     = environment;
     hostname             = hostname = Dns.GetHostName();
 }
        /// <summary>
        /// Creates the provider
        /// </summary>
        /// <param name="options"></param>
        public LambdaILoggerProvider(LambdaLoggerOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _options = options;
        }
示例#3
0
        /// <summary>
        /// Creates the provider
        /// </summary>
        /// <param name="options"></param>
        public LambdaILoggerProvider(LambdaLoggerOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _options       = options;
            _loggers       = new ConcurrentDictionary <string, LambdaILogger>();
            _scopeProvider = options.IncludeScopes ? new LoggerExternalScopeProvider() : NullExternalScopeProvider.Instance;
        }
        [CLSCompliant(false)] // https://github.com/aspnet/Logging/issues/500
        public static ILoggerFactory AddLambdaLogger(this ILoggerFactory factory, LambdaLoggerOptions options)
        {
            if (factory == null)
            {
                throw new ArgumentNullException(nameof(factory));
            }
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            var provider = new LambdaILoggerProvider(options);

            factory.AddProvider(provider);
            return(factory);
        }
示例#5
0
        [CLSCompliant(false)] // https://github.com/aspnet/Logging/issues/500
        public static ILoggingBuilder AddLambdaLogger(this ILoggingBuilder builder, LambdaLoggerOptions options)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            var provider = new LambdaILoggerProvider(options);

            builder.AddProvider(provider);
            return(builder);
        }
示例#6
0
        [CLSCompliant(false)] // https://github.com/aspnet/Logging/issues/500
        public static ILoggerFactory AddBunyanLambdaLogger(this ILoggerFactory factory, IConfiguration configuration)
        {
            if (factory == null)
            {
                throw new ArgumentNullException(nameof(factory));
            }
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            var options  = new LambdaLoggerOptions(configuration);
            var provider = new BunyanLambdaILoggerProvider(options);

            factory.AddProvider(provider);
            return(factory);
        }
        [CLSCompliant(false)] // https://github.com/aspnet/Logging/issues/500
        public static ILoggerFactory AddLambdaLogger(this ILoggerFactory factory, IConfiguration configuration, string loggingSectionName)
        {
            if (factory == null)
            {
                throw new ArgumentNullException(nameof(factory));
            }
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }
            if (string.IsNullOrEmpty(loggingSectionName))
            {
                throw new ArgumentNullException(nameof(loggingSectionName));
            }

            var options  = new LambdaLoggerOptions(configuration, loggingSectionName);
            var provider = new LambdaILoggerProvider(options);

            factory.AddProvider(provider);
            return(factory);
        }
        [CLSCompliant(false)] // https://github.com/aspnet/Logging/issues/500
        public static ILoggerFactory AddLambdaLogger(this ILoggerFactory factory)
        {
            var options = new LambdaLoggerOptions();

            return(AddLambdaLogger(factory, options));
        }
 // Constructor
 public LambdaILogger(string categoryName, LambdaLoggerOptions options)
 {
     _categoryName = categoryName;
     _options      = options;
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="categoryName"></param>
 /// <param name="options"></param>
 public BunyanLambdaILogger(string categoryName, LambdaLoggerOptions options)
 {
     this.categoryName = string.IsNullOrEmpty(categoryName) ? DEFAULT_CATEGORY_NAME : categoryName;
     this.options      = options;
 }
示例#11
0
 // Constructor
 public LambdaILogger(string categoryName, LambdaLoggerOptions options)
 {
     _categoryName = string.IsNullOrEmpty(categoryName) ? DEFAULT_CATEGORY_NAME : categoryName;
     _options      = options;
 }
示例#12
0
        [CLSCompliant(false)] // https://github.com/aspnet/Logging/issues/500
        public static ILoggerFactory AddBunyanLambdaLogger(this ILoggerFactory factory, LambdaLoggerOptions options,
                                                           string applicationName, string environment = null)
        {
            if (factory == null)
            {
                throw new ArgumentNullException(nameof(factory));
            }
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            var provider = new BunyanLambdaILoggerProvider(options, applicationName, environment);

            factory.AddProvider(provider);
            return(factory);
        }
示例#13
0
        [CLSCompliant(false)] // https://github.com/aspnet/Logging/issues/500
        public static ILoggingBuilder AddLambdaLogger(this ILoggingBuilder builder)
        {
            var options = new LambdaLoggerOptions();

            return(AddLambdaLogger(builder, options));
        }
示例#14
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 /// <param name="applicationName"></param>
 /// <param name="environment"></param>
 public BunyanLambdaILoggerProvider(LambdaLoggerOptions options, string applicationName, string environment = null)
 {
     this.options         = options ?? throw new ArgumentNullException(nameof(options));
     this.applicationName = applicationName;
     this.environment     = environment;
 }
示例#15
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 public BunyanLambdaILoggerProvider(LambdaLoggerOptions options)
 {
     this.options = options ?? throw new ArgumentNullException(nameof(options));
 }