public static ILoggerFactory AddAWSProvider()

in src/AWS.Logger.AspNetCore/AWSLoggerFactoryExtensions.cs [43:57]


        public static ILoggerFactory AddAWSProvider(this ILoggerFactory factory, AWSLoggerConfigSection configSection, Func<LogLevel, object, Exception, string> formatter = null)
        {
            // If configSection is null. Assuming the logger is being activated in a debug environment
            // and skip adding the provider. We don't want to prevent developers running their application
            // locally because they don't have access or want to use AWS for their local development.
            if (configSection == null)
            {
                factory.CreateLogger("AWS.Logging.AspNetCore").LogWarning("AWSLoggerConfigSection is null. LogGroup is likely not configured in config files. Skipping adding AWS Logging provider.");
                return factory;
            }

            var provider = new AWSLoggerProvider(configSection, formatter);
            factory.AddProvider(provider);
            return factory;
        }