hi,when i using spring cloud config(version is 2.2.2.Release) , i want to make the properties ‘logging.file.name’ sharing with defferent microservice. so i place "logging.file.name" into the file application.yml in spring cloud config project, but not effective when i get endpoint of demo-service like "http://localhost:8080/actuator/logfile"(that url is belong to demo-service)
this is my config central dir:
my spring cloud config bootstrap.yml like this:
the application.yml that contain some properties that i want to share with many different microservice:
Comment From: ryanjbaxter
What does not effective mean?
Comment From: vidbin
What does not effective mean?
sorry, my english is so poor. i want to make the property, logging.file.name that spring boot build-in ,shared between all microservices, so i place the property in resources with file names in application.yml. but when i visiting the actuator endpoint 'logfile' of config-client, i can't get log. in the backend console, it show message like this : "Missing 'logging.file.name' or 'logging.file.path' properties".
Comment From: spencergibb
what does /actuator/env
say?
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: vidbin
the /actuator/env
show that the value of LOG_FILE
is logs/demo-service/demo-service-9595.log
that is congurated in spring cloud config center application.yml
file shared beteewen with many other microservices.
Comment From: spencergibb
Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.
Comment From: vidbin
this is a minimal sample. you can visit ‘http://localhost:9595/actuator/logfile’ that will be no log file exsiting. config-central-sample.zip
Comment From: spencergibb
Sorry for the delay. From config server
$ http :7070/demo-service/default
HTTP/1.1 200
Connection: keep-alive
Content-Type: application/json
Date: Tue, 30 Mar 2021 17:48:58 GMT
Keep-Alive: timeout=60
Transfer-Encoding: chunked
{
"label": null,
"name": "demo-service",
"profiles": [
"default"
],
"propertySources": [
{
"name": "classpath:/native-config/application.yml",
"source": {
"logging.file.name": "logs/${spring.application.name}/${spring.application.name}-${server.port}.log",
"logging.level.root": "info",
"management.endpoint.health.show-details": "always",
"management.endpoints.web.exposure.include": "*"
}
}
],
"state": null,
"version": null
}
And from the microservice (using boot 2.3.9 and Hoxton.SR10)
http :9595/actuator/env/logging.file.name (10007)[13:52:39]
HTTP/1.1 200
Connection: keep-alive
Content-Disposition: inline;filename=f.txt
Content-Type: application/vnd.spring-boot.actuator.v3+json
Date: Tue, 30 Mar 2021 17:52:41 GMT
Keep-Alive: timeout=60
Transfer-Encoding: chunked
{
"activeProfiles": [],
"property": {
"source": "bootstrapProperties-classpath:/native-config/application.yml",
"value": "logs/demo-service/demo-service-9595.log"
},
"propertySources": [
{
"name": "bootstrapProperties-classpath:/native-config/application.yml",
"property": {
"value": "logs/demo-service/demo-service-9595.log"
}
}
]
}
Looks like it is working.
Comment From: spring-cloud-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-cloud-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.