chikibee
chikibee

Reputation: 21

actuator logfile on SpringBoot 1.5.* is not working. Http 404

Hi I am facing an issue with the Spring Boot (version 1.5.9) logfile actuator URL. When I visit localhost:8080/appctx/logfile, it throws http 404

Here are the config details.

  endpoints.enabled=true
  endpoints.sensitive=false
  management.security.enabled=false
  endpoints.health.sensitive=false
  endpoints.logfile.sensitive=false
  logging.level.org.springframework.boot.autoconfigure.logging=DEBUG

Upvotes: 2

Views: 3099

Answers (2)

V.Y.
V.Y.

Reputation: 379

In my case it turned out to be the linux path was incorrect. Specifically

/absolute/path/to/my/app/logs/log-file.log

did not work

Once I changed it to a relative path

./logs/log-file.log

it worked

Hope this helps

Upvotes: 0

lzagkaretos
lzagkaretos

Reputation: 2910

As stated in documentation for endpoint /logfile:

Returns the contents of the logfile (if logging.file or logging.path properties have been set). Supports the use of the HTTP Range header to retrieve part of the log file’s content.

You may have not set up logging.file or logging.path in your application.properties.

Try setting:

logging.file=myapplication.log

More information about logging in Spring Boot you can find here.

Update: Created a working demo here with endpoint /logfile up and running.

Upvotes: 4

Related Questions