env, heapdump and threaddump leak internals. Expose them only behind authentication,
or move the whole actuator to its own port: management.server.port=9001.
Health for Kubernetes
management.endpoint.health.probes.enabled=true
/actuator/health/liveness — is the process healthy? restart if not
/actuator/health/readiness — can it take traffic? remove from the load balancer if not
Trace and span ids land in the log pattern automatically, so a log line can be matched to a
trace.
Logging
logging.level.root=INFOlogging.level.com.example=DEBUGlogging.file.name=logs/app.loglogging.console.enabled=true # new in Spring Boot 4: set false in container setupslogging.structured.format.console=ecs # JSON logs: ecs, gelf, logstash
privatestaticfinalLoggerlog=LoggerFactory.getLogger(BookService.class);log.info("Created book id={} title={}",id,title);//placeholders,notconcatenation