Last active
March 3, 2025 16:53
-
-
Save shortthirdman/5a4035a6f43df9180fe9064f7010be99 to your computer and use it in GitHub Desktop.
Spring Boot (2.x or 3.x or above) Configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server: | |
shutdown: graceful | |
compression: | |
enabled: true | |
port: 8080 | |
address: localhost | |
error: | |
include-binding-errors: ALWAYS | |
include-exception: true | |
include-message: ALWAYS | |
include-path: ALWAYS | |
include-stacktrace: ALWAYS | |
whitelabel: | |
enabled: false | |
max-http-request-header-size: 4MB | |
servlet: | |
application-display-name: ${spring.application.name} | |
context-path: /app | |
encoding: | |
charset: UTF-8 | |
enabled: true | |
spring: | |
application: | |
name: spring-boot-app | |
lifecycle: | |
timeout-per-shutdown-phase: 1m | |
cloud: | |
discovery: | |
enabled: true | |
config: | |
enabled: true | |
cache: | |
type: none | |
codec: | |
log-request-details: true | |
mvc: | |
log-request-details: true | |
problemdetails: | |
enabled: true | |
format: | |
date-time: "yyyy-MM-dd HH:mm:ss" | |
data: | |
jpa: | |
auditing: | |
enabled: true | |
repositories: | |
enabled: true | |
# transaction: | |
# default-timeout: 15 | |
# rollback-on-commit-failure: true | |
jpa: | |
show-sql: true | |
open-in-view: false | |
hibernate: | |
ddl-auto: update | |
generate-ddl: true | |
main: | |
allow-bean-definition-overriding: true | |
keep-alive: true | |
log-startup-info: true | |
allow-circular-references: false | |
register-shutdown-hook: true | |
web-application-type: SERVLET | |
servlet: | |
multipart: | |
enabled: true | |
file-size-threshold: 25KB | |
max-file-size: 1MB | |
max-request-size: 5MB | |
logging: | |
charset: | |
console: UTF-8 | |
file: UTF-8 | |
pattern: | |
console: "%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){green} %5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}] %clr([%level]){magenta} %c{1.6} [%t] %m%n" | |
file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}] %-5level %logger{36} - %msg%n" | |
include-application-name: true | |
file: | |
name: ${logging.file.path}/app.log | |
path: logs | |
level: | |
root: INFO # General logging level for the application | |
org.springframework.web: DEBUG # Log HTTP requests and responses | |
org.springframework.data.jpa.repository: DEBUG # Log JPA repository method calls | |
org.hibernate.SQL: DEBUG # Log SQL statements executed by Hibernate | |
org.hibernate.type.descriptor.sql: TRACE # Log SQL parameter binding | |
springdoc: | |
enable-spring-security: false | |
api-docs: | |
version: openapi_3_1 | |
enabled: true | |
resolve-schema-properties: true | |
path: /v3/api-docs | |
groups: | |
enabled: true | |
packages-to-exclude: /error | |
remove-broken-reference-definitions: true | |
show-actuator: false | |
show-login-endpoint: false | |
swagger-ui: | |
path: /swagger-ui | |
deep-linking: true | |
deepLinking: true | |
display-operation-id: true | |
displayOperationId: true | |
display-request-duration: true | |
displayRequestDuration: true | |
enabled: true | |
operations-sorter: alpha | |
show-extensions: true | |
tags-sorter: alpha | |
syntaxHighlight: | |
theme: monokai | |
use-fqn: true | |
use-management-port: false | |
writer-with-default-pretty-printer: true | |
management: | |
httpexchanges: | |
recording: | |
enabled: true | |
include: "*" | |
tracing: | |
sampling: | |
probability: 1.0 | |
metrics: | |
distribution: | |
percentiles-histogram: | |
http: | |
server: | |
requests: true | |
info: | |
env: | |
enabled: true | |
health: | |
readiness-state: | |
enabled: true | |
liveness-state: | |
enabled: true | |
endpoint: | |
env: | |
show-values: always | |
health: | |
probes: | |
enabled: true | |
group: | |
custom: | |
show-components: always | |
show-details: always | |
quartz: | |
enabled: true | |
scheduledtasks: | |
enabled: true | |
shutdown: | |
enabled: true | |
startup: | |
enabled: true | |
endpoints: | |
enabled-by-default: true | |
web: | |
discovery: | |
enabled: true | |
exposure: | |
include: "*" | |
eureka: | |
client: | |
enabled: true | |
instance: | |
statusPageUrlPath: ${server.servlet.context-path}/info | |
healthCheckUrlPath: ${server.servlet.context-path}/health |
Comments are disabled for this gist.