mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Extended documentation for applicaiton pid monitoring
This commit is contained in:
parent
620d8eb87e
commit
3ebaf11550
@ -119,7 +119,8 @@ When you're ready to push your Spring Boot application to production, we've got
|
||||
* *Monitoring:*
|
||||
<<production-ready-features.adoc#production-ready-metrics, Metrics>> |
|
||||
<<production-ready-features.adoc#production-ready-auditing, Auditing>> |
|
||||
<<production-ready-features.adoc#production-ready-tracing, Tracing>>
|
||||
<<production-ready-features.adoc#production-ready-tracing, Tracing>> |
|
||||
<<production-ready-features.adoc#production-ready-process-monitoring, Process>>
|
||||
|
||||
== Advanced topics
|
||||
Lastly, we have a few topics for the more advanced user.
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user