Adding one of my thought, it would be better if we can externalize the System ENV property key name (in Christoph code the key is "environment"), because the application may already having some key to set its environment to prod, staging or dev, etc. eg: if we are using spring its having *spring.profiles.active *as to set its current environment.
-- Thanks & Regards Sreekanth Nair Java Developer