/actuator/loggers Java Microservice

I want to have access to the /actuator/loggers endpoint. I want to be able to change the logging level dynamically for the service deployed on the edge instance.

I tried configuring an endpoint in application.properties

management.endpoints.web.exposure.include=loggers
management.endpoint.loggers.enabled=true
management.endpoints.web.base-path=/actuator

This works locally but when deployed any endpoint on the service is throwing

{
“error”: “Microservice/Bad gateway”,
“message”: “Microservice not available Connection refused : Connection for request 21e744c3b46d66295ac38084f2390e73 already closed”,
“info”: “https://www.cumulocity.com/guides/reference-guide”
}

Is there any way around it or what would be the correct way to set this up so the platform is happy ?

Thanks

Edge 1018.0.457
Java SDK 1018.603.0
Springboot 2.7.6

Hi @waldemar.bus and welcome to the community! :waving_hand:

Try to add the full service-name / context path to the base-path.

Example:
Assuming your microservice name is hello-world using the URL https://<yourTenant>/service/hello-world.

Instead of adding just /actuator try /service/hello-world/actuator.

Thank you but I tried that. With no extra configuration I just get 404 on
GET https://platform-url/service/service-name/actuator

With application.properties config of the actuator none of the service endpoints work.
Since health endpoint is configured in cumulocity.json I am guessing that you restrict direct access to the actuator ?

NVM, thank you for replying but looks like you expose all the actuator endpoint in root.

This:

POST {{edge-url}}/service/doxxxme-tracker/loggers/com.xxxsoftware
Accept: application/json
Authorization: Basic {{basic-auth-edge}}
Content-Type: application/json

{ “configuredLevel”: “DEBUG” }

Seems to work right out of the box. Silly me :sweat_smile: But maybe someone else will find this useful.

2 Likes