I want to set
This is an old question but I'll answer it in case sombebody else (like me) ends up here looking for this information.
HIBERNATE_FORMAT_SQL should do the trick
Actually it is not the OS environment variable that is "translated" but rather the Spring property name that is.
The name is translated in several ways and looked up against available environment variables. E.g. "hibernate.format.sql" is looked up as:
Then the same with UPPERCASE:
Although you cannot set an environment variable with a dot in the name with the set or export commands it is however possible with the env command. I defer judgement whether this is a good idea or not:
env "my.dotted.name=\"a value\"" the-command-you-want-to-run
Have a look at SystemEnvironmentPropertySource.java for details. I link to a specific version but you should make sure to look at the version you are using.
To troubleshoot these kinds of problems in a production environment you could try turning on debug logging for the property resolving code:
logging: level: org.springframework.core.env: DEBUG
... or by setting the appropriate environment variable :)