Configuration Values
This allows you to dump a complete set of configuration values to the log.
logger.LogConfigurationValues(IConfiguration config, LogLevel level, ConfigurationDiagnosticsOptions options = null)
Where:
loggeris theILoggerwhere you want the information logged.configis theIConfigurationthat contains the configuration information.levelis theLogLevelat which you wish the information to be logged.optionsare the options to use for logging. If not supplied then theConfigurationDiagnosticsOptions.GlobalOptionsare used.
Example output
info: Example.Startup[0]
The following values are available:
AllowedHosts : *
ALLUSERSPROFILE : C:\ProgramData
APPDATA : C:\Users\colin\AppData\Roaming
applicationName : Example
ASPNETCORE_ENVIRONMENT : Development
ASPNETCORE_URLS : https://localhost:5001;http://localhost:5000
ENVIRONMENT : Development
HOMEDRIVE : C:
Logging :
Logging:LogLevel :
Logging:LogLevel:Default : Information
Logging:LogLevel:Microsoft : Warning
Logging:LogLevel:Microsoft.Hosting.Lifetime : Information
...
Alternative calls
logger.LogConfigurationValuesAsInformation(IConfiguration config, ConfigurationDiagnosticsOptions options = null)
logger.LogConfigurationValuesAsDebug(IConfiguration config, ConfigurationDiagnosticsOptions options = null)
logger.LogConfigurationValuesAsTrace(IConfiguration config, ConfigurationDiagnosticsOptions options = null)