diff --git a/ENVIRONMENT.md b/ENVIRONMENT.md index c9b78a2..68dbf46 100644 --- a/ENVIRONMENT.md +++ b/ENVIRONMENT.md @@ -165,6 +165,8 @@ Define additional login buttons on the logon screen (see [documentation](https://doc.owncloud.com/server/latest/admin_manual/configuration/server/config_sample_php_parameters.html#define-additional-login-buttons-on-the-logon-screen)). - `OWNCLOUD_LOGIN_POLICY_ORDER=` \ Ordered list of login policy class names. Comma-separated (see [documentation](https://doc.owncloud.com/server/latest/admin_manual/configuration/server/config_sample_php_parameters.html#define-additional-login-buttons-on-the-logon-screen)). +- `OWNCLOUD_LOG_CONDITIONS=` \ + Define conditional logging rules as a JSON-encoded array of condition objects, e.g. `[{"apps":["files_external"],"loglevel":0}]` (see [documentation](https://doc.owncloud.com/server/latest/admin_manual/configuration/server/config_sample_php_parameters.html#define-log-conditions)). - `OWNCLOUD_LOG_DATE_FORMAT=` \ Define the log date format (see [documentation](https://doc.owncloud.com/server/latest/admin_manual/configuration/server/config_sample_php_parameters.html#define-the-log-date-format)). - `OWNCLOUD_LOG_FILE=${OWNCLOUD_VOLUME_FILES}/owncloud.log` \ diff --git a/v20.04/overlay/etc/templates/config.php b/v20.04/overlay/etc/templates/config.php index 2d81903..d2730f5 100644 --- a/v20.04/overlay/etc/templates/config.php +++ b/v20.04/overlay/etc/templates/config.php @@ -253,6 +253,18 @@ function getConfigFromEnv() { $config['log_rotate_size'] = (int) getenv('OWNCLOUD_LOG_ROTATE_SIZE'); } + // 'log.conditions' is a list of condition maps with mixed scalar/array + // values (apps, users, logfile, loglevel, shared_secret), which the flat + // env-var idioms used elsewhere here cannot represent. It is therefore + // passed as a JSON-encoded array, e.g.: + // OWNCLOUD_LOG_CONDITIONS='[{"apps":["files_external"],"loglevel":0}]' + if (getenv('OWNCLOUD_LOG_CONDITIONS') != '') { + $logConditions = json_decode(getenv('OWNCLOUD_LOG_CONDITIONS'), true); + if (is_array($logConditions)) { + $config['log.conditions'] = $logConditions; + } + } + if (getenv('OWNCLOUD_ENABLE_PREVIEWS') != '') { $config['enable_previews'] = getenv('OWNCLOUD_ENABLE_PREVIEWS') === 'true'; } diff --git a/v22.04/overlay/etc/templates/config.php b/v22.04/overlay/etc/templates/config.php index 2d81903..d2730f5 100644 --- a/v22.04/overlay/etc/templates/config.php +++ b/v22.04/overlay/etc/templates/config.php @@ -253,6 +253,18 @@ function getConfigFromEnv() { $config['log_rotate_size'] = (int) getenv('OWNCLOUD_LOG_ROTATE_SIZE'); } + // 'log.conditions' is a list of condition maps with mixed scalar/array + // values (apps, users, logfile, loglevel, shared_secret), which the flat + // env-var idioms used elsewhere here cannot represent. It is therefore + // passed as a JSON-encoded array, e.g.: + // OWNCLOUD_LOG_CONDITIONS='[{"apps":["files_external"],"loglevel":0}]' + if (getenv('OWNCLOUD_LOG_CONDITIONS') != '') { + $logConditions = json_decode(getenv('OWNCLOUD_LOG_CONDITIONS'), true); + if (is_array($logConditions)) { + $config['log.conditions'] = $logConditions; + } + } + if (getenv('OWNCLOUD_ENABLE_PREVIEWS') != '') { $config['enable_previews'] = getenv('OWNCLOUD_ENABLE_PREVIEWS') === 'true'; } diff --git a/v24.04/overlay/etc/templates/config.php b/v24.04/overlay/etc/templates/config.php index 7622cfd..fe38444 100644 --- a/v24.04/overlay/etc/templates/config.php +++ b/v24.04/overlay/etc/templates/config.php @@ -306,6 +306,18 @@ function getConfigFromEnv() { $config['log_rotate_size'] = (int) getenv('OWNCLOUD_LOG_ROTATE_SIZE'); } + // 'log.conditions' is a list of condition maps with mixed scalar/array + // values (apps, users, logfile, loglevel, shared_secret), which the flat + // env-var idioms used elsewhere here cannot represent. It is therefore + // passed as a JSON-encoded array, e.g.: + // OWNCLOUD_LOG_CONDITIONS='[{"apps":["files_external"],"loglevel":0}]' + if (getenv('OWNCLOUD_LOG_CONDITIONS') != '') { + $logConditions = json_decode(getenv('OWNCLOUD_LOG_CONDITIONS'), true); + if (is_array($logConditions)) { + $config['log.conditions'] = $logConditions; + } + } + if (getenv('OWNCLOUD_ENABLE_PREVIEWS') != '') { $config['enable_previews'] = getenv('OWNCLOUD_ENABLE_PREVIEWS') === 'true'; }