spring-cloud-commons
spring-cloud-commons copied to clipboard
The logfile in the configuration center does not take effect for actuator
This enhancement request comes from this problem
Also,This looks to be very similar to this problem with Spring Cloud Config which was closed as feedback was not provided.
- environment
- SpringBoot:2.6.8
- SpringCloud:2021.0.2
- SpringCloudAlibaba:2021.0.1.0
- nacos:2.1.0
- important step
-
pom.xmladd dependencyspring-boot-starter-actuator - modify the configuration
- Add the following configuration to
bootstrap.ymlorapplication.ymllogging: file: name: ./log/a.log - Add the following configuration in the
nacosconfiguration centermanagement: endpoints: web: exposure: include: "logfile" # enable log endpoint logging: file: name: ./log/b.log
- Add the following configuration to
- start server
- Open the
logfolder, Contains two filesa.logandb.log, Logs are refreshed inb.log
-
- issue
- Browser open url
http://[ip]:[port]/actuator/logfile,Only the file content ofa.logis displayed - If
logging.file.nameis not configured inbootstrap.ymlorapplication.yml, A404error code is displayed when visit the url
- Browser open url
- a complete yet minimal sample, include documentation