Search code examples
spring-bootlogbackspring-boot-actuator

Actuator - custom logfile endpoint possible?


I have set up my log configuration using logback.

The configuration sets up my logs in a rolling manner in a custom location. This means that I'm not using either:

"logging.file" or "logging.path" in my application.yml configuration, and as a consequence, the logfile endpoint no longer works.

Does anybody know of a way to customize this endpoint, so that I can point to the location/file specified in my logback.xml configuration?


Solution

  • Reading the two sections on Logging 26 & 74. It looks like it recommends using the logback-spring.xml config file with the base.xml configuration. With that you can still use the logging.file or logging.path application properties within the configuration. That way the /logfile endpoint is still valid for the current log file (probably won't look into the rolling files if that is what you setup).