The Spring Boot Products API reads all its runtime configuration fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ricpalomino/spring-boot/llms.txt
Use this file to discover all available pages before exploring further.
src/main/resources/application.properties. Spring Boot’s externalized configuration system means you can override any property through environment variables, JVM flags, or profile-specific property files without touching the packaged artifact. The sections below walk through each property group and explain how to adapt them for your environment.
Full application.properties
The file ships with sensible defaults that work out of the box on a local machine:Application name
| Property | Value |
|---|---|
spring.application.name | demo |
Logging levels
These three properties control how verbose each package’s output is:| Property | Default | Description |
|---|---|---|
logging.level.root | INFO | Baseline level for all packages not matched by a more specific rule |
logging.level.com.zegel.springboot | DEBUG | Full debug output for application code |
logging.level.org.springframework.web | INFO | Spring MVC request mapping and dispatcher logs |
WARN or ERROR in production to reduce noise. See the logging guide for per-package overrides at runtime.
Log output patterns
| Property | Pattern |
|---|---|
logging.pattern.console | %d{yyyy-MM-dd HH:mm:ss} - %msg%n |
logging.pattern.file | %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %X{traceId} - %msg%n |
%X{traceId}, a value written to the SLF4J MDC by LoggingInterceptor at the start of each HTTP request. This lets you filter all log lines for a single request by its trace ID.
File logging and rotation
| Property | Value | Description |
|---|---|---|
logging.file.name | logs/application.log | Path to the active log file, relative to the working directory |
logging.file.max-size | 10MB | Maximum size of a single log file before rotation |
logging.file.max-history | 10 | Number of rotated files to keep |
logging.file.total-size-cap | 100MB | Hard cap on total disk usage across all rotated files |
logs/application.log reaches 10 MB, Logback renames it with a date-and-index suffix (e.g., application-2026-05-19.0.log) and opens a fresh file. Older files are deleted once the archive crosses 100 MB.
The application listens on port 8080 by default. To use a different port, add
server.port=9090 (or your preferred value) to application.properties, or pass -Dserver.port=9090 on the command line.Spring profiles
You can create environment-specific overrides without modifying the base file. Spring Boot automatically loadsapplication-{profile}.properties alongside application.properties when a profile is active, with the profile file taking precedence.
Create a profile file
Add
src/main/resources/application-prod.properties with only the properties you want to override:dev, test, and prod, but you can use any name that makes sense for your workflow.