Search code examples
spring-bootlogback-groovy

Sprint boot - get environment or active profiles in logback.groovy


In logback-spring.xml I know it's possible to access environment properties (in my case the active profile) with but I'm looking for the groovy equivalent.


Solution

  • There's no equivalent for logback.groovy. As things stand, if you want to access the environment or the active profiles in your logging configuration you'll need to use logback-spring.xml.

    If you'd like to see equivalent support in logback.groovy, please open an enhancement request.