Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Should it be possible to set logging levels through environment variables alone in a Spring Boot application?

I don't want to use application.properties as I'm running on Cloud Foundry and want to pick up changes without a deploy (but after the app has restarted, or restaged to be more precise).

I've tried setting env vars like LOGGING_LEVEL_ORG_SPRINGFRAMEWORK=TRACE but that has no effect. Putting logging.level.org.springframework: TRACE in application.properties does work though.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
236 views
Welcome To Ask or Share your Answers For Others

1 Answer

This is just an idea, but did you try setting

_JAVA_OPTIONS=-Dlogging.level.org.springframework=TRACE?

Theoretically, this way -Dlogging.level.org.springframework=TRACE will be passed as default JVM argument and should affect every JVM instance in your environment.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...