Skip to content

Commit 3ebaf11

Browse files
committed
Extended documentation for applicaiton pid monitoring
1 parent 620d8eb commit 3ebaf11

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

spring-boot-docs/src/main/asciidoc/documentation-overview.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ When you're ready to push your Spring Boot application to production, we've got
119119
* *Monitoring:*
120120
<<production-ready-features.adoc#production-ready-metrics, Metrics>> |
121121
<<production-ready-features.adoc#production-ready-auditing, Auditing>> |
122-
<<production-ready-features.adoc#production-ready-tracing, Tracing>>
122+
<<production-ready-features.adoc#production-ready-tracing, Tracing>> |
123+
<<production-ready-features.adoc#production-ready-process-monitoring, Process>>
123124

124125
== Advanced topics
125126
Lastly, we have a few topics for the more advanced user.

spring-boot-docs/src/main/asciidoc/production-ready-features.adoc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,34 @@ servlet containers support a uniform Java DSL for customizing the error handling
746746

747747

748748

749+
[[production-ready-process-monitoring]]
750+
== Process monitoring
751+
In Spring Boot Actuator you can find `ApplicationPidListener` which creates file
752+
containing application PID (by default in application directory and file name is
753+
`application.pid`). It's not activated by default, but you can do it in two simple
754+
ways described below.
755+
756+
757+
758+
[[production-ready-process-monitoring-configuration]]
759+
=== Extend configuration
760+
In `META-INF/spring.factories` file you have to activate the listener:
761+
[indent=0]
762+
----
763+
org.springframework.context.ApplicationListener=\
764+
org.springframework.boot.actuate.system.ApplicationPidListener
765+
----
766+
767+
768+
769+
[[production-ready-process-monitoring-programmatically]]
770+
=== Programmatically
771+
You can also activate this listener by invoking `SpringApplication.addListeners(...)`
772+
method and passing `ApplicationPidListener` object. You can also customize file name
773+
and path through constructor.
774+
775+
776+
749777
[[production-ready-whats-next]]
750778
== What to read next
751779
If you want to explore some of the concepts discussed in this chapter, you can take a

0 commit comments

Comments
 (0)