in src/AWS.Logger.AspNetCore/AWSLoggerConfigSection.cs [29:50]
public static AWSLoggerConfigSection GetAWSLoggingConfigSection(this IConfiguration configSection, string configSectionInfoBlockName = DEFAULT_BLOCK)
{
var loggerConfigSection = configSection.GetSection(configSectionInfoBlockName);
AWSLoggerConfigSection configObj = null;
if (loggerConfigSection[AWSLoggerConfigSection.LOG_GROUP] != null)
{
configObj = new AWSLoggerConfigSection(loggerConfigSection);
}
// If the code was relying on the default config block and no log group was found then
// check the legacy default block.
else if(string.Equals(configSectionInfoBlockName, DEFAULT_BLOCK, StringComparison.InvariantCulture))
{
loggerConfigSection = configSection.GetSection(LEGACY_DEFAULT_BLOCK);
if (loggerConfigSection[AWSLoggerConfigSection.LOG_GROUP] != null)
{
configObj = new AWSLoggerConfigSection(loggerConfigSection);
}
}
return configObj;
}