一、前言
Spring Boot Admin 有一個強大的功能,就是實時在線查看日志,並且可以動態更改日志級別。具體用法師非常的簡單,可以說是傻瓜式的都不為過。
二、代碼演示
修改pom.xml文件:
spring: application: name: microservice-consumer boot: admin: client: url: http://localhost:8888 server: port: 8201 management: endpoints: web: exposure: include: '*' endpoint: health: show-details: ALWAYS logging: file: path: /log name: microservice-consumer.log
運行項目后,我們便可以在Spring Boot admin 上更改日志級別。默認是info
查看實時日志