Local Development Configuration
Overriding Configuration Locally
Spring Boot provides several ways to override configuration without modifying files that are committed to Git.
Option 1: External config Directory (Recommended)
Spring Boot automatically loads configuration files from a config/ subdirectory in the working directory. This directory is already listed in .gitignore.
Create configuration files in the config/ directory at the project root:
config/application.yml
logging:
level:
org.hibernate.SQL: DEBUG
org.hibernate.type.descriptor.sql.BasicBinder: TRACE
za.co.idealogic.event.admin: TRACE
Spring Boot loads files from config/ with higher priority than src/main/resources/config/, so your local settings will override the defaults.
|
Common Debug Scenarios
| Scenario | Logger | Level |
|---|---|---|
SQL queries |
|
DEBUG |
SQL parameter binding |
|
TRACE |
Application services |
|
DEBUG/TRACE |
Security/authentication |
|
DEBUG |
HTTP client calls (WebClient) |
|
DEBUG |
Hazelcast cache |
|
DEBUG |
Example: Full Debug Configuration
config/application.yml
logging:
level:
ROOT: DEBUG
org.hibernate.SQL: DEBUG
org.hibernate.type.descriptor.sql.BasicBinder: TRACE
za.co.idealogic.event.admin: TRACE
org.springframework.security: DEBUG
reactor.netty.http.client: DEBUG
spring:
jpa:
show-sql: true
properties:
hibernate.format_sql: true
Remember that config/ is gitignored. Your local configuration will not be committed.
|