Spring Boot: Core Common Properties and Default Value

These are core properties that can be configured with any Spring Boot Application. These properties are already configured in Spring Boot with the given default value.

Note: In your application, You don’t need to add all these values in your application.proprties/ application.YAML file. You just need to add only those values which you want to change/override.

See Also:

Banner Properties

Name Default Value Description
banner.charset UTF-8 Banner file encoding.
banner.location classpath:banner.txt Banner file location.
banner.image.location classpath:banner.gif Banner image file location, also use jpg/png.
banner.image.width 76 Width of the banner image in chars.
banner.image.height Height of the banner image in chars.
banner.image.margin 2 Left hand image margin in chars.
banner.image.invert false If images need to inverted for dark terminal themes.

Logging Properties

Name Default Value Description
logging.config Location of the logging configuration file. For instance `classpath:logback.xml` for Logback
logging.exception-conversion-word %wEx Conversion word used when logging exceptions.
logging.file Log file name. For instance `myapp.log`
logging.level.* Log levels severity mapping. For instance logging.level.org.springframework=DEBUG
logging.path Location of the log file. For instance ‘/var/log’
logging.pattern.console Appender pattern for output to the console. Only supported with the default logback setup.
logging.pattern.file Appender pattern for output to the file. Only supported with the default logback setup.
logging.pattern.level Appender pattern for log level (default %5p). Only supported with the default logback setup.
logging.register-shutdown-hook false Register a shutdown hook on time of initialization for the logging system.

AOP Properties

Name Default Value Description
spring.aop.auto true Add @EnableAspectJAutoProxy.
spring.aop.proxy-target-class false false when Standard Java interface-based proxies. true when subclass-based (CGLIB) proxies.

Application Identity Properties

Spring Boot load these properties in ContextIdApplicationContextInitializer class.

Name Default Value Description
spring.application.index Application index.
spring.application.name Application name

Admin Properties

Spring Boot load these properties in SpringApplicationAdminJmxAutoConfiguration class.

Name Default Value Description
spring.application.admin.enabled false Enable admin features for the application.
spring.application.admin.jmx-name org.springframework.boot:type=Admin,name=SpringApplication #JMX name of the application admin MBean.

Auto Configuration Properties

Name Default Value Description
spring.autoconfigure.exclude Auto-configuration classes to exclude.

Spring Core Properties

Name Default Value Description
spring.beaninfo.ignore true Skip search of BeanInfo classes.

Spring Cache Properties

Spring Boot load these properties in CacheProperties class.

Name Default Value Description
spring.cache.cache-names If supported by cache manager, then mentioned Comma-separated list.
spring.cache.caffeine.spec The specification to use to create caches. For Example: Check CaffeineSpec for more details on the spec format.
spring.cache.couchbase.expiration 0 By default the entries never expire(You can write in milliseconds).
spring.cache.ehcache.config Configuration file location to initialize EhCache.
spring.cache.guava.spec The specification to use to create caches.For Example: Check CacheBuilderSpec for more details on the spec format.
spring.cache.hazelcast.config Configuration file location to initialize Hazelcast.
spring.cache.infinispan.config Configuration file location to initialize Infinispan.
spring.cache.jcache.config Configuration file location to initialize the cache manager
spring.cache.jcache.provider Fully qualified name of the Cache Provider implementation to use to retrieve the JSR-107 compliant cache manager. It only required if more than one JSR-107 implementation is available on the classpath.
spring.cache.type Cache type, auto-detected according to the environment.

Spring Config Properties

Spring Boot load these properties in ConfigFileApplicationListener class when using environment properties.

Name Default Value Description
spring.config.location Config file locations
spring.config.name application Config file name.

HAZELCAST Properties

Spring Boot load these properties in HazelcastProperties class.

Name Default Value Description
spring.hazelcast.config The location of the configuration file to initialize Hazelcast.

Project Information Properties

Spring Boot load these properties in ProjectInfoProperties class.

Name Default Value Description
spring.info.build.location classpath:META-INF/build-info.properties Location for generated build-info.properties file.
spring.info.git.location classpath:git.properties Location generforated git.properties file.

JMX Properties

Name Default Value Description
spring.jmx.default-domain JMX domain name.
spring.jmx.enabled true Expose management beans for JMX domain.
spring.jmx.server mbeanServer MBeanServer bean name.

Email Properties

Spring Boot load these properties in MailProperties class.

Name Default Value Description
spring.mail.default-encoding UTF-8 Default MimeMessage encoding.
spring.mail.host SMTP server host. For instance ‘smtp.example.com’
spring.mail.jndi-name Session JNDI name. When set, takes precedence to others mail settings.
spring.mail.password Login password of the SMTP server.
spring.mail.port SMTP server port.
spring.mail.properties.* Additional JavaMail session properties
spring.mail.protocol smtp Protocol used by the SMTP server.
spring.mail.test-connection false Mail server is available on startup.
spring.mail.username Login user of the SMTP server.

Application Settings Properties

Spring Boot load these properties in SpringApplication class.

Name Default Value Description
spring.main.banner-mode console Mode for display the banner when the application startup.
spring.main.sources Sources (class name, package name or XML resource location) in the ApplicationContext.
spring.main.web-environment Run the application in a web environment. it auto-detected by default.

File Encoding Properties

Spring Boot load these properties in FileEncodingApplicationListener class.

Name Default Value Description
spring.mandatory-file-encoding Expected character encoding the application must use.

Internationalization Properies

Spring Boot load these properties in MessageSourceAutoConfiguration class.

Name Default Value Description
spring.messages.always-use-message-format false Setting whether to always apply the MessageFormat rules, parsing even messages without arguments.
spring.messages.basename messages Comma-separated list of basenames and each following the ResourceBundle convention.
spring.messages.cache-seconds -1 Loaded resource bundle files cache expiration, in seconds. When set to -1, bundles are cached forever.
spring.messages.encoding UTF-8 Message bundles encoding.
spring.messages.fallback-to-system-locale true Setting to fall back to the system Locale if no files for a specific Locale have been found.

Output Properties

Name Default Value Description
spring.output.ansi.enabled detect Configure the ANSI output.

PID FILE Properties

Spring Boot load these properties in ApplicationPidFileWriter class.

Name Default Value Description
spring.pid.fail-on-write-error Fail if ApplicationPidFileWriter is used but not write the PID file.
spring.pid.file Location to PID file to write. if ApplicationPidFileWriter is used.

Profile Properties

Name Default Value Description
spring.profiles.active A comma-separated list of active profiles.
spring.profiles.include Unconditionally activate the specified comma separated profiles

SENDGRID Properties

Spring Boot load these properties in SendGridAutoConfiguration class.

Name Default Value Description
spring.sendgrid.api-key SendGrid api key (alternative to username/password)
spring.sendgrid.username SendGrid account username
spring.sendgrid.password SendGrid account password
spring.sendgrid.proxy.host SendGrid proxy host
spring.sendgrid.proxy.port SendGrid proxy

References

https://docs.spring.io/spring-boot/docs/1.4.x/reference/html/common-application-properties.html

2 thoughts on “Spring Boot: Core Common Properties and Default Value”