spring-cloud / spring-cloud/spring-cloud-commons

The logfile in the configuration center does not take effect for actuator

Open
#1,115 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting-for-triage
Dominant language
Java
Stars
751
Forks
744
Avg merge
1d 14h
Merged PRs (30d)
9

Description

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
    1. pom.xml add dependency spring-boot-starter-actuator
    2. modify the configuration
      • Add the following configuration to bootstrap.yml or application.yml
        logging:
          file:
            name: ./log/a.log
        
      • Add the following configuration in the nacos configuration center
        management:
          endpoints:
            web:
              exposure:
                include: "logfile" # enable log endpoint
        logging:
          file:
            name: ./log/b.log
        
    3. start server
    4. Open the log folder, Contains two files a.log and b.log, Logs are refreshed in b.log
  • issue
    • Browser open url http://[ip]:[port]/actuator/logfile,Only the file content of a.log is displayed
    • If logging.file.name is not configured in bootstrap.yml or application.yml, A 404 error code is displayed when visit the url
  • a complete yet minimal sample, include documentation

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked minimal sample and its pom.xml, then reproduce the behavior using bootstrap.yml or application.yml and the Nacos configuration shown in the issue. Check the actuator/logfile endpoint with logging.file.name defined locally and remotely. Done means the endpoint reflects the effective configuration-center logfile, including the case where no local logging.file.name is configured.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
api, backend, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.