- Mastering Spring Boot 2.0
- Dinesh Rajput
- 243字
- 2021-06-25 21:29:19
Exposing application information
In Spring Boot, Actuator also provides arbitrary application information by using the /info endpoint. If you make a GET request call to the /info endpoint, by default it will return empty JSON, {}.
The empty JSON means Spring Boot doesn't provide default information for your application. The /info endpoint provides any information for your Spring application that you want to expose to your client or the public. You can add any information about your application to this endpoint in application.properties or application.yml as follows:
application.properties
info.app.name=Spring Boot Actuator Application info.app.description=This is my first Working Spring Actuator Examples info.app.version=0.0.1-SNAPSHOT info.helpline.email=admin@dineshonjava.com info.helpline.phone=0120-000001100
application.yml
info: app: name: Spring Boot Actuator Application description: This is my first Working Spring Actuator Examples version: 0.0.1-SNAPSHOT helpline: email: admin@dineshonjava.com phone: 0120-000001100
In the preceding examples, you can see that we want to provide some information about our application such as application name, description, version, email, and helpline number in the /info endpoint response. Now let's request the /info endpoint; you'll get the following response:
{ helpline: { email: "admin@dineshonjava.com", phone: "0120-00000110" }, app: { description: "This is my first Working Spring Actuator Examples", version: "0.0.1-SNAPSHOT", name: "Spring Boot Actuator Application" } }
As shown, the Spring Boot Actuator /info endpoint exposes information about your application to the outside of your application. This information might be useful for callers.
Let's see in the next section how to kill your application using an Actuator's endpoint.
- Excel公式、函數(shù)與圖表應(yīng)用大全
- 用友ERP-U8(8.72版)標(biāo)準(zhǔn)財(cái)務(wù)模擬實(shí)訓(xùn)
- Office 2019高效辦公三合一從入門(mén)到精通(視頻自學(xué)版)
- 計(jì)算機(jī)聯(lián)鎖圖冊(cè)(第二版)
- Word-Excel-PPT 2010辦公應(yīng)用從入門(mén)到精通(實(shí)戰(zhàn)強(qiáng)化版)
- Word Excel PPT 三合一 效率手冊(cè):早做完,不加班
- 高效隨身查:PPT2021必學(xué)的美化設(shè)計(jì)應(yīng)用技巧(視頻教學(xué)版)
- 快·易·通:2天學(xué)會(huì)PPT幻燈片設(shè)計(jì)與制作(2016版)
- Excel 2013從入門(mén)到精通
- PPT制作事半功倍
- Excel 2010基礎(chǔ)入門(mén)與辦公應(yīng)用
- 電腦辦公直通車(chē)
- 文秘辦公自動(dòng)化培訓(xùn)教程
- Unity 3D\2D手機(jī)游戲開(kāi)發(fā):從學(xué)習(xí)到產(chǎn)品(第3版)
- Office2010高級(jí)應(yīng)用教程