Currently AddFile(IConfiguraton) methods expect that passed config section is a parent (usually, "Logging" section) for "File" section and this section name ("File") is hardcoded. It might be a need to use another section name, or have more than one file logging provider that are configured in appsettings.json. It easy to modify configuration processing in this way:
if passed IConfiguration contains "File" subsection use it as before (which guarantees full backward compatibility)
otherwise, if passed IConfiguration contain "Path" property (which is only required property to enable file logger), use it as a "File" section to handle "File" configuration section that is passed explicitly, for example loggingBuilder.AddFile(loggingSection.GetSection("FileLogAll"))
Currently
AddFile(IConfiguraton)
methods expect that passed config section is a parent (usually, "Logging" section) for "File" section and this section name ("File") is hardcoded. It might be a need to use another section name, or have more than one file logging provider that are configured in appsettings.json. It easy to modify configuration processing in this way:IConfiguration
contains "File" subsection use it as before (which guarantees full backward compatibility)IConfiguration
contain "Path" property (which is only required property to enable file logger), use it as a "File" section to handle "File" configuration section that is passed explicitly, for exampleloggingBuilder.AddFile(loggingSection.GetSection("FileLogAll"))