appsettings.json
ASP.NET Core's configuration file
| Type | object |
|---|---|
| File match |
appsettings.json
appsettings.*.json
|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/appsettings-json/latest.json |
| Source | https://www.schemastore.org/appsettings.json |
Validate with Lintel
npx @lintel/lintel check
Properties
ASP.NET Core Kestrel server configuration.
3 nested properties
Endpoints that Kestrel listens to for network requests. Each endpoint has a name specified by its JSON property name.
Default configuration applied to all endpoints. Named endpoint specific configuration overrides defaults.
3 nested properties
The protocols enabled on the endpoint.
Specifies allowable SSL protocols. Defaults to 'None' which allows the operating system to choose the best protocol to use, and to block protocols that are not secure. Unless your app has a specific reason not to, you should use this default. Available in .NET 5 and later.
Specifies the client certificate requirements for a HTTPS connection. Defaults to 'NoCertificate'. Available in .NET 5 and later.
Certificates that Kestrel uses with HTTPS endpoints. Each certificate has a name specified by its JSON property name. The 'Default' certificate is used by HTTPS endpoints that haven't specified a certificate.
Configuration for Microsoft.Extensions.Logging.
7 nested properties
Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.
4 nested properties
Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.
Name of the log message formatter to use. Defaults to 'simple'.
Log message formatter options. Additional properties are available on the options depending on the configured formatter. The formatter is specified by FormatterName.
3 nested properties
Include scopes when true. Defaults to false.
Format string used to format timestamp in logging messages. Defaults to null.
Indication whether or not UTC timezone should be used to for timestamps in logging messages. Defaults to false.
Log level threshold.
1 nested properties
Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.
1 nested properties
Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.
1 nested properties
Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.
1 nested properties
Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.
1 nested properties
Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.
ASP.NET Core host filtering middleware configuration. Allowed hosts is a semicolon-delimited list of host names without port numbers. Requests without a matching host name will be refused. Host names may be prefixed with a '.' wildcard, or use '' to allow all hosts.
Connection string configuration. Get connection strings with the IConfiguration.GetConnectionString(string) extension method.
Definitions
Settings for WebOptimizer.Core
Determines if the "cache-control" HTTP headers should be set and if conditional GET (304) requests should be supported. This could be helpful to disable while in development mode.
Determines if <script> and <link> elements should point to the bundled path or a reference per source file should be created. This is helpful to disable when in development mode.
Definitions for WebEssentials.AspNetCore.CdnTagHelpers
An absolute URL used as a prefix for static resources
If true, injects a tag that speeds up DNS resolution to the CDN.
The cache identifier of the service worker (can be any string). Change this property to force the service worker to reload in browsers.
The route to the page to show when offline.
Determines if a script that registers the service worker should be injected into the bottom of the HTML page.
Determines if a meta tag that points to the web manifest should be inserted at the end of the head element.
A comma separated list of routes to pre-cache when service worker installs in the browser.
Selects one of the predefined service worker types.
An elmah.io API key with the Messages | Write permission.
The Id of the elmah.io log to store messages in.
An application name to put on all error messages.
A list of HTTP status codes (besides 404) to log even though no exception is thrown.
Include log messages from Microsoft.Extensions.Logging as breadcrumbs.
The Id of the elmah.io heartbeat to notify.
The protocols enabled on the endpoint.
Certificate configuration.
The certificate file path. If a file path is specified then the certificate will be loaded from the file system.
The certificate key file path. Available in .NET 5 and later.
The certificate password used to access the private key.
The certificate subject. If a subject is specified then the certificate will be loaded from the certificate store.
The certificate store name. Defaults to 'My'.
The certificate store location. Defaults to 'CurrentUser'.
A value indicating whether or not to load certificates that are considered invalid. Defaults to false.
Specifies allowable SSL protocols. Defaults to 'None' which allows the operating system to choose the best protocol to use, and to block protocols that are not secure. Unless your app has a specific reason not to, you should use this default. Available in .NET 5 and later.
Specifies the client certificate requirements for a HTTPS connection. Defaults to 'NoCertificate'. Available in .NET 5 and later.
ASP.NET Core Kestrel server configuration.
Endpoints that Kestrel listens to for network requests. Each endpoint has a name specified by its JSON property name.
Default configuration applied to all endpoints. Named endpoint specific configuration overrides defaults.
3 nested properties
The protocols enabled on the endpoint.
Specifies allowable SSL protocols. Defaults to 'None' which allows the operating system to choose the best protocol to use, and to block protocols that are not secure. Unless your app has a specific reason not to, you should use this default. Available in .NET 5 and later.
Specifies the client certificate requirements for a HTTPS connection. Defaults to 'NoCertificate'. Available in .NET 5 and later.
Certificates that Kestrel uses with HTTPS endpoints. Each certificate has a name specified by its JSON property name. The 'Default' certificate is used by HTTPS endpoints that haven't specified a certificate.
Log level threshold.
Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.
Configuration for Microsoft.Extensions.Logging.
Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.
4 nested properties
Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.
Name of the log message formatter to use. Defaults to 'simple'.
Log message formatter options. Additional properties are available on the options depending on the configured formatter. The formatter is specified by FormatterName.
3 nested properties
Include scopes when true. Defaults to false.
Format string used to format timestamp in logging messages. Defaults to null.
Indication whether or not UTC timezone should be used to for timestamps in logging messages. Defaults to false.
Log level threshold.
1 nested properties
Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.
1 nested properties
Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.
1 nested properties
Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.
1 nested properties
Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.
1 nested properties
Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.
ASP.NET Core host filtering middleware configuration. Allowed hosts is a semicolon-delimited list of host names without port numbers. Requests without a matching host name will be refused. Host names may be prefixed with a '.' wildcard, or use '' to allow all hosts.
Connection string configuration. Get connection strings with the IConfiguration.GetConnectionString(string) extension method.
NLog configuration
Automatically reload the NLog configuration when notified that appsettings.json file has changed.
Throws an exception when there is a config error? If not set, then throwExceptions will be used for this setting.
Throws an exception when there is an error. For unit testing only and advanced troubleshooting.
The minimal log level for the internal logger.
Write internal log to the specified filepath
Write internal log to a console
Write internal log to a console with error stream
Log events below this threshold are not logged.
Automatically call LogFactory.Shutdown on AppDomain.Unload or AppDomain.ProcessExit
Load NLog extension packages for additional targets and layouts
[]
Key-value pair of variables
Wrap all defined targets with this custom target wrapper.
{}
1 nested properties
{}
1 nested properties
Wrap all defined targets using AsyncWrapper with OverflowAction=Discard for better performance.
Redirect LogEvents from matching Logger objects to specified targets
Match Logger objects based on their Logger-name. Can use wildcard characters ('*' or '?').
Rule identifier to allow rule lookup with Configuration.FindRuleByName and Configuration.RemoveRuleByName.
Comma separated list of levels that this rule matches.
Name or names of a target - separated by comma. Remove this property for sending events to the blackhole.
Ignore further rules if this one matches.
Default action if none of the filters match.
Serilog appSettings Configuration
Pointer to the schema against which this document should be validated.
Using section contains list of assemblies in which configuration methods. Can be required depending of the project type: See: https://github.com/serilog/serilog-settings-configuration#using-section-and-auto-discovery-of-configuration-assemblies
Minimum LogLevel Threshold. (Support dynamic reload if the underlying IConfigurationProvider supports it)
This section defines a static list of key-value pairs that will enrich log events.
This section defines Enriches that will be applied to log events.
This section defines filters that will be applied to log events.
This section configures the sinks that log events will be emitted to.
This section configures sinks for auditing, instead of regular (safe) logging. Obs: When auditing is used, exceptions from sinks and any intermediate filters propagate back to the caller.