Spring Boot. Endpoint missed / logfile

I have a problem with an endpoint logfile

in my spring boot application - it missed. This is my app config:

server:
  port: 8081

info:
  app:
    name: Foo Service
    component: Foo Service

secret-message: "{cipher}a702d2b5b0c6bc2db67e7d487c6142e7c23254108503d1856ff516d0a64bbd3663a2514a86647dcf8467d042abcb8a6e"

logging:
  file: "target/foo.log"

management:
  context-path: "/actuator"

spring:
  application:
    name: "foo-service"
  boot:
    admin:
      url: http://spring-boot-admin-url:9000
      client:
        health-url: http://app-url:8081/actuator/health
        management-url: http://app-url:8081/actuator
        service-url: http://app-url:8081
        metadata:
          user.name: "${security.user.name}"
          user.password:  "${security.user.password}"
      username: "${security.user.name}"
      password: "${security.user.password}"

security:
  user:
    name: name
    password: password

      

Spring version of the starter motor drive 1.5.2

. In addition, the endpoints /info

and /health

work well.

+3


source to share


2 answers


Are you getting 404 (not found) or 401 (unauthorized)? If the latter is the case, add

endpoints:
   logfile:
      sensitive: false

      



Otherwise you can enable autoconfiguration by setting the level to DEBUG and searching for "logfile". This may give you some clues if and why the endpoint was not enabled.

logging.level.org.springframework.boot.autoconfigure.logging=DEBUG

+3


source


If you got 401 unauthorized access, please read this document first .



By default, all sensitive HTTP endpoints are secured so that only users with the ACTUATOR role can access them. Security using the standard HttpServletRequest.isUserInRole method.

[Tip] Use the management.security.roles property if you want something other than ACTUATOR.

If you are deploying applications behind a firewall, you may prefer that all endpoints of your actuator can be accessed without authentication. You can do this by changing the management.security.enabled property:

application.properties.

management.security.enabled = false

+2


source







All Articles