EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login
Home Software Development Software Development Tutorials Spring Tutorial Spring Boot Properties
Secondary Sidebar
Spring Tutorial
  • Spring Boot
    • What is Spring Boot
    • Spring Boot flyway
    • Spring Boot framework
    • Spring Boot Logback
    • Spring Boot actuator endpoints
    • Spring Boot gRPC
    • Spring Boot jdbctemplate example
    • Spring Boot ehcache
    • Spring Boot Architecture
    • Spring Boot Port
    • Introduction of spring boot
    • Spring Boot ide
    • Spring Boot Netty
    • Spring Boot ORM
    • Spring Boot Versions
    • Spring Boot JUnit
    • Spring Boot Keycloak
    • Spring Boot gradle
    • Spring Boot Lombok
    • Spring Boot autowired
    • Spring Boot bean
    • Spring Boot hibernate
    • Spring Boot integration test
    • Spring Boot jdbc
    • Spring Boot MongoDB
    • Spring Boot postgresql
    • Spring Boot rest
    • Spring Boot swagger
    • Spring Boot thymeleaf
    • Spring Boot Unit Test
    • Spring Boot Webflux
    • Spring Boot webclient
    • Spring Boot kubernetes
    • Spring Boot Properties
    • Spring Boot Validation
    • Spring Boot Feature
    • Spring Boot Application
    • Spring Boot email
    • Spring Boot MVC
    • Spring Boot Exception Handling
    • Spring Boot Starter Parent
    • Spring Boot Docker
    • Spring Boot Logging
    • Spring Boot Query
    • Spring Boot Multiple Data Sources
    • Spring Boot Basic Authentication
    • Spring Boot Test
    • Spring Boot jwt
    • Spring Boot Liquibase
    • Spring Boot Prometheus
    • Spring Boot debug
    • Spring Boot GraalVM
    • Spring Boot Batch
    • Spring Boot controller
    • Spring Boot CLI
    • Spring Boot file upload
    • Spring Boot interceptor
    • Spring Boot Service
    • Spring Boot Configuration
    • Spring Boot Datasource Configuration
    • Spring Boot Annotations
    • Spring Boot Starter We
    • Spring Boot Actuator
    • Spring Boot DevTools
    • Spring Boot Repository
    • Spring Boot Dependencies
    • Spring Boot Path Variable
    • Spring Boot Microservices
    • Spring Boot Run Command
    • Spring Boot application.properties
    • Spring Boot Transaction Management
    • Spring Boot Banner
    • Spring Boot JPA
    • Spring Boot Change Port
    • Spring Boot RestTemplate
    • Spring Boot cors
    • Spring Boot HTTPS
    • Spring Boot OAuth2
    • Spring Boot Profiles
    • Spring Boot Interview Questions
    • Spring Boot filter
    • Spring boot logging level
    • Spring Boot Cache
    • Spring Boot Advantages
    • Spring Boot Scheduler
    • Spring Boot Initializr
    • Spring Boot Maven
    • Spring Boot Admin
    • Spring Boot Tomcat
    • Spring Boot WebSocket
    • Spring Boot Executable Jar
    • Spring Boot CommandLineRunner
    • Spring Boot DataSource
    • Spring Batch Scheduler
    • Spring Batch Example
    • Spring Batch Tasklet
    • Spring Batch Admin
    • Spring Batch
    • Spring Boot Qualifier
    • Spring Boot War
    • Spring Boot Test Configuration
  • Spring
    • What is Spring Framework?
    • Spring Architecture
    • What is Spring Integration?
    • IoC Containers
    • What is AOP?
    • Spring Modules
    • Spring Batch Processing
    • Spring Batch Partitioner
    • Spring Batch Job
    • Spring AOP
    • Spring Expression Language
    • Dependency Injection in Spring
    • Spring Batch Architecture
    • Spring framework Interview Questions
  • Spring Cloud Basics
    • What is Spring Cloud
    • Spring Cloud Contract
    • Spring Cloud Components
    • Spring Cloud Version
    • Spring Cloud Data Flow
    • Spring cloud stream
    • Spring Cloud Dependencies
    • Spring cloud microservices
    • spring cloud gateway
    • Spring Cloud Config
    • Spring Cloud Kubernetes
    • Spring Cloud Sleuth

Related Courses

Spring Boot Certification Course

Spring Framework Course Training

All in One Data Science Course

Spring Boot Properties

Advanced C++ ProgrammingSpring Boot Properties

Introduction to Spring Boot

In Spring boot application, we have different ways to configure the properties for the project; we can use any of them. In comparison to the Spring framework, Spring Boot is very easy and makes a lot of configuring for us automatically. We have mainly 3 ways by which we can configure the spring application, but spring boot provided one easy way to do this by using a properties file, we can have all the application related configuration inside that file only, these properties can be very from the environment to environment. Here we will see its internal working and how we can configure all the things for our application in detail to better understand.

List of Spring Boot Properties

Here we will see different types of properties that we need to make in order to provide configuration for our application. This can be done via .properties file or .yml files in spring boot. In both the files, we have different type of syntax that need to follow; otherwise, the application will not run.

Let’s get started with the different type of properties we have in common:

All in One Software Development Bundle(600+ Courses, 50+ projects)
Python TutorialC SharpJavaJavaScript
C Plus PlusSoftware TestingSQLKali Linux
Price
View Courses
600+ Online Courses | 50+ projects | 3000+ Hours | Verifiable Certificates | Lifetime Access
4.6 (86,697 ratings)

Key for Property

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

Description (what it does)
logging.file.path This property will help us to mention the path for the log file.
debug This property will enable the debug logs for us.
logging.config This property will tell us the location which will contain the logging configuration, for example, any .xml file or etc.
info.* This property will add the info endpoint.
logging.charset.file This will tell the Charset used for the file output.
logging.charset.console This will set the charset for the console output.
logging.file.name This property is used to mention the logging file name.
logging.exception-conversion-word This property is sued to tell the conversion words which are being used when logging exceptions.
logging.group.* This property is sued to log groups.
logging.logback.rollingpolicy.clean-history-on-start This property is used to clean up the archive log files but on startup.
logging.level.* This property is used to set the log level.

logging.level.org.springframework=INFO

logging.pattern.console This property is used to set the appender pattern, which will show the logs on the console.
logging.logback.rollingpolicy.max-history This property is used to set the number of days we can kept the archive logs.
logging.logback.rollingpolicy.file-name-pattern This property is used to roll over the file name (log file name).
logging.logback.rollingpolicy.max-file-size By the use of this, we can set the maximum size for the log file.
logging.logback.rollingpolicy.total-size-cap This property will set the size for the backup file.
logging.pattern.file This property will tell the Appender pattern for the file output.
logging.pattern.dateformat This property will tell the Appender pattern for the date format.
spring.application.admin.jmx-name Used for the JMX name for the spring application.
spring.aop.auto This will enable the auto proxy AspectJ.
logging.pattern.level This property will set the Appender pattern for log level.
spring.aop.proxy-target-class Proxy is to be true.
spring.application.admin.enabled This is used to enable the admin feature for the application or not.
spring.banner.image.invert This property is used to check the weather the image for the dark terminal.
spring.application.name This is used to give the application name.
spring.banner.charset This property issued for banner file encoding.
spring.autoconfigure.exclude To exclude the classes from the auto-configuration.
spring.banner.image.bitdepth Used for bit path.
spring.banner.image.height Used for the height for the banner images.
spring.banner.image.location It will tell the file location.
spring.banner.image.width Used to set the width of the banner image.
spring.banner.image.margin Merging for the banner image.
spring.config.import This property will help us to import the additional configuration data.
spring.config.name This will tell the config name.
spring.config.location This will tell the config file location.
spring.info.build.location Will tell the location to the build file.
spring.info.build.encoding Tell the build encoding.
spring.info.git.encoding File encoding.
spring.jmx.default-domain Will tell the JMX default domain.
spring.jmx.server JMX server name.
spring.main.banner-mode Tell the mode to display the banner.
spring.main.cloud-platform Check whether the cloud platform is overridden or not.
spring.main.allow-bean-definition-overriding Check whether the bean definition is over ridden or not.
spring.main.register-shutdown-hook This will take true or false and check whether the application has shut up a hook or not.
spring.main.log-startup-info This property is used for logging the information or logs when the application startups it also takes true or false as the value.
spring.messages.always-use-message-format Takes true or false as the value and try to apply the message format rules and parse the messages.
spring.messages.fallback-to-system-locale Fallback of the system also takes a value as true or false.
trace This property helps to enable the trace logs; it also takes the Boolean value as true or false; by default, it is false.

All the properties that we have seen above come under the core properties of the spring boot; we also have cache, database and many more properties which are required in the application. We can also configure the security, Jackson, database, and other required property in the files when needed.

We have so many properties of the spring boot application out of which we have shown some of them above; now we can see one sample file which contains the properties of the application, we will see both the the files .properties and .yml.

  • .properties file
  • .yml file

Example:

Below find the sample file for the configuration which are required to run the application.

Code:

spring:
application:
name: ABC
profile: Development
banner:
location: banner.txt
datasource:
driverClassName: com.mysql.cj.jdbc.Driver
url: your url to the db
username: coc
liquibase:
enabled: true
change-log: classpath:db/your file
jpa:
hibernate:
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
servlet:
multipart:
enabled: true
file-size-threshold: 2KB
max-file-size: 200MB
max-request-size: 215MB
security:
oauth2:
resourceserver:
jwt:
jwk-set-uri: your token configuration goes here
issuer-uri : if any
jackson:
mapper:
accept_case_insensitive_properties: true

Conclusion

By using properties, we can make so many configurations very easily in spring boot. Most of the configuration is automatically added in spring boot when we create the project from scratch; we just need to do the application-specific configuration under the requirement. All these are very easy to use and handle as well.

Recommended Articles

This is a guide to Spring Boot Properties. Here we discuss the introduction and list of spring boot properties for better understanding. You may also have a look at the following articles to learn more –

  1. Maven Repository Spring
  2. Spring Boot DevTools
  3. Spring AOP
  4. Spring Cloud Components
Popular Course in this category
Spring Boot Training Program (2 Courses, 3 Project)
  2 Online Courses |  3 Hands-on Projects |  22+ Hours |  Verifiable Certificate of Completion
4.5
Price

View Course

Related Courses

Spring Framework Training (4 Courses, 6 Projects)4.9
All in One Data Science Bundle (360+ Courses, 50+ projects)4.8
0 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Software Development Course

C# Programming, Conditional Constructs, Loops, Arrays, OOPS Concept

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more