diff --git a/spring-boot-docs/src/main/asciidoc/documentation-overview.adoc b/spring-boot-docs/src/main/asciidoc/documentation-overview.adoc index 1dfda097aca..62aa9a6ad0c 100644 --- a/spring-boot-docs/src/main/asciidoc/documentation-overview.adoc +++ b/spring-boot-docs/src/main/asciidoc/documentation-overview.adoc @@ -119,7 +119,8 @@ When you're ready to push your Spring Boot application to production, we've got * *Monitoring:* <> | <> | -<> +<> | +<> == Advanced topics Lastly, we have a few topics for the more advanced user. diff --git a/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc index 3fb6d7c3c13..06a8b1d140c 100644 --- a/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc @@ -746,6 +746,34 @@ servlet containers support a uniform Java DSL for customizing the error handling +[[production-ready-process-monitoring]] +== Process monitoring +In Spring Boot Actuator you can find `ApplicationPidListener` which creates file +containing application PID (by default in application directory and file name is +`application.pid`). It's not activated by default, but you can do it in two simple +ways described below. + + + +[[production-ready-process-monitoring-configuration]] +=== Extend configuration +In `META-INF/spring.factories` file you have to activate the listener: +[indent=0] +---- +org.springframework.context.ApplicationListener=\ +org.springframework.boot.actuate.system.ApplicationPidListener +---- + + + +[[production-ready-process-monitoring-programmatically]] +=== Programmatically +You can also activate this listener by invoking `SpringApplication.addListeners(...)` +method and passing `ApplicationPidListener` object. You can also customize file name +and path through constructor. + + + [[production-ready-whats-next]] == What to read next If you want to explore some of the concepts discussed in this chapter, you can take a