1 system.install system_update_1017()

Moves system logging settings from variables to config.

Related topics

File

core/modules/system/system.install, line 1949
Install, update and uninstall functions for the system module.

Code

function system_update_1017() {
  // Convert error levels.
  switch ((int) update_variable_get('error_level', '2')) {
    case 0:
      $error_level = 'hide';
      break;
    case 1:
      $error_level = 'some';
      break;
    default:
      $error_level = 'all';
  }

  // Migrate variables to config.
  $config = config('system.core');
  $config->set('log_row_limit', update_variable_get('dblog_row_limit', 1000));
  $config->set('log_identity', update_variable_get('syslog_identity', 'backdrop'));
  $config->set('log_facility', update_variable_get('syslog_facility', LOG_LOCAL0));
  $config->set('log_format', update_variable_get('syslog_format', '!base_url|!timestamp|!type|!ip|!request_uri|!referer|!uid|!link|!message'));
  $config->set('error_level', $error_level);
  $config->save();

  // Delete variables.
  update_variable_del('error_level');
  update_variable_del('dblog_row_limit');
  update_variable_del('syslog_identity');
  update_variable_del('syslog_facility');
  update_variable_del('syslog_format');
}