Cumulocity-IoT / cumulocity-microservice-templates

Collection of templates / examples to give the developer a starting point how common features can be solved by using Cumulocity Microservice SDK for Java. Developed by Global Competency Center IoT
Apache License 2.0
11 stars 5 forks source link

Change log level dynamically not working #26

Closed ButKor closed 11 months ago

ButKor commented 11 months ago

I'm trying out the basic example, specifically the functionality to change the log level dynamically as described here: https://github.com/SoftwareAG/cumulocity-microservice-templates/tree/main/basic#changing-the-log-level-dynamically

However, this does not seem to work. Steps I've did:

  1. Clone repository on main branch
  2. do mvn clean install
  3. create the application in my tenant & subscribe
  4. get bootstrap credentials and add them to application-dev.properties
  5. making sure there's management.endpoints.web.exposure.include=health, loggers line in application-dev.properties
  6. Run build: java -Dspring.profiles.active=dev -jar cumulocity-microservice-templates-basic-0.0.1-SNAPSHOT.jar

Service runs fine on my localhost, a curl http://localhost:8080/health returns up. However, none of these calls returning logger info:

Am I missing something here? Is it working on your side?

ButKor commented 11 months ago

Found the problem and it was quite obvious: I was missing authentication. curl http://localhost:8080/loggers -u '{tenant}/{user}:{pass}' works fine.