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:*
|
* *Monitoring:*
|
||||||
<<production-ready-features.adoc#production-ready-metrics, Metrics>> |
|
<<production-ready-features.adoc#production-ready-metrics, Metrics>> |
|
||||||
<<production-ready-features.adoc#production-ready-auditing, Auditing>> |
|
<<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
|
== Advanced topics
|
||||||
Lastly, we have a few topics for the more advanced user.
|
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]]
|
[[production-ready-whats-next]]
|
||||||
== What to read next
|
== What to read next
|
||||||
If you want to explore some of the concepts discussed in this chapter, you can take a
|
If you want to explore some of the concepts discussed in this chapter, you can take a
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue