Use environment variables to control the amount of log information
It’s typical to want more detailed logging information in development and test environments. In production, the focus is on responding to error situations, so additional details might obscure error messages and increase the time it takes to troubleshoot a problem.
To address this, you can configure Liquibase to vary the amount of logging information based on the target environment.
Note: Environment variables do not override the CLI usage. In automation driven by crafting dynamic CLI strings to execute, you need to reconcile commands and their arguments with specific settings in your environment variables that are overridden by the CLI usage.
In this example,
Non-production environments will have
LIQUIBASE_LOG_LEVEL=”INFO”
Production environments will have
LIQUIBASE_LOG_LEVEL=”SEVERE”
if ($EnvType = "Prod") then
export LIQUIBASE_LOG_LEVEL="SEVERE"
else
export LIQUIBASE_LOG_LEVEL="INFO"
<call Liquibase update command here>