admin管理员组文章数量:1126441
For example, the configuration property spring.main.log-startup-info would be an environment variable named SPRING_MAIN_LOGSTARTUPINFO
This is simple and only control feature from spring-boot.
But this spring.jpa.properties.hibernate.session.events.log.LOG_QUERIES_SLOWER_THAN_MS contains uppercase and underscore.
How convert this properties
I read this instructions
Binding From Environment Variables
and I try convert this: spring.jpa.properties.hibernate.session.events.log.LOG_QUERIES_SLOWER_THAN_MS
to this SPRING_JPA_PROPERTIES_HIBERNATE_SESSION_EVENTS_LOG_LOG_QUERIES_SLOWER_THAN_MS
but not works when export to linux ubuntu environment.
For example, the configuration property spring.main.log-startup-info would be an environment variable named SPRING_MAIN_LOGSTARTUPINFO
This is simple and only control feature from spring-boot.
But this spring.jpa.properties.hibernate.session.events.log.LOG_QUERIES_SLOWER_THAN_MS contains uppercase and underscore.
How convert this properties
I read this instructions
Binding From Environment Variables
and I try convert this: spring.jpa.properties.hibernate.session.events.log.LOG_QUERIES_SLOWER_THAN_MS
to this SPRING_JPA_PROPERTIES_HIBERNATE_SESSION_EVENTS_LOG_LOG_QUERIES_SLOWER_THAN_MS
but not works when export to linux ubuntu environment.
Share Improve this question asked 2 days ago Carlos EduardoCarlos Eduardo 1141 silver badge5 bronze badges1 Answer
Reset to default 0You could keep the mentioned property in application.yml
and populate its value from arbitrary environment variable.
Just export the variable in the terminal:
export LOG_QUERIES_SLOWER_THAN_MS=20
and specify this in your config file:
spring:
jpa:
properties:
hibernate.session.events.log.LOG_QUERIES_SLOWER_THAN_MS: ${LOG_QUERIES_SLOWER_THAN_MS:10}
Here LOG_QUERIES_SLOWER_THAN_MS
is be the name of referenced environment variable and 10
the default value applied when the variable is not set.
本文标签:
版权声明:本文标题:How convert this spring-boot propertie spring.jpa.properties.hibernate.session.events.log.LOG_QUERIES_SLOWER_THAN_MS to environm 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736623381a1945622.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论