How to get Environment properties from application.properties into logback.groovy in Spring Boot project?
问题 Trying to inject properties defined in application.properties/application.yml into logback.groovy script in Spring Boot project. I cannot Inject Environment or ApplicationContext into groovy scripts. Are there any workarounds? I am not looking for solutions like System.getProperty('spring.profiles.active') src/main/resources/logback.groovy import org.springframework.core.env.Environment @Inject private Environment env; //this is not working. how to get env here? println "spring.profiles