0

如何配置 Spring Boot Admin 以记录操作。例如,当有人将日志级别从 INFO 更改为 DEBUG 或有人更改 JMX 选项卡中的配置值并编写错误的配置覆盖现有配置时,我想要 Spring Boot Admin 日志操作。

Spring Boot Admin 是否具有执行此操作的功能?

4

2 回答 2

1

不,它没有,但您可以编写一个zuul过滤器拦截、分析请求/api/applications/{id}/logfile并编写日志语句。

于 2017-10-06T16:32:30.707 回答
0

Spring Boot 包含许多附加功能,可帮助您在应用程序投入生产时对其进行监控和管理。您可以选择使用 HTTP 端点、JMX 甚至远程 shell(SSH 或 Telnet)来管理和监视您的应用程序。审计、健康和指标收集可以自动应用于您的应用程序。

Actuator HTTP 端点仅适用于基于 Spring MVC 的应用程序。特别是,除非您也启用 Spring MVC,否则它不适用于 Jersey。

您还可以通过调用 SpringApplication.addListeners(...​) 方法并传递适当的 Writer 对象来激活侦听器。此方法还允许您通过 Writer 构造函数自定义文件名和路径。

在执行器中自定义您的要求

https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#production-ready

马文:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
    <version>1.5.2.RELEASE</version>
</dependency>

http://www.baeldung.com/spring-boot-authentication-audit

于 2017-10-06T16:45:02.037 回答