Answers.Body: <p>It's not a setting you can set with Civi::settings. You can set it with a define() anywhere outside of civicrm.settings.php, but it would need to run that section in your file before running the code where it gets used, so somewhere pretty early in a page run. It always falls back to CIVICRM_DSN if CIVICRM_LOGGING_DSN is not set, if your setting runs too late.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-18T21:00:56.133Z
Answers.Text: Just to make sure I understand. Would it need to get called every single time before civicrm.settings.php (before a Civi page is even starting to load)? If that is the case, maybe a drupal hook would work?
Answers.UserDisplayName: Sleewok
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-18T21:03:58.137Z
Answers.Text: Yes that might work if the drupal module has a higher weight than the civicrm module (e.g. the weight field in the drupal system table in drupal 7).
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-18T21:11:37.740Z
Answers.Text: I mean lower weight, oops. See https://www.drupal.org/docs/7/creating-custom-modules/howtos/how-to-update-a-modules-weight
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-18T20:56:54.810Z
Answers.LastActivityDate: 2019-02-18T20:56:54.810Z
Answers.UserDisplayName: Demerit
Body: <p>Is it possible to use PHP to define the CIVICRM_LOGGING_DSN setting located in civicrm.settings.php? We are using Drupal.</p>
  
  <p>I have successfully used the following to change some settings before: </p>
  
  <p><code>Civi::settings()-&gt;set('customPHPPathDir', "$root/CustomPHP/");</code></p>
  
  <p>Thanks for any help!</p>
  
Tags: <civicrm.settings.php><drush><aegir>
Title: Define CIVICRM_LOGGING_DSN in PHP?
ThreadText: # Define CIVICRM_LOGGING_DSN in PHP?
  
  (Asked by: username_0 on 2019-02-18)
  
  Is it possible to use PHP to define the CIVICRM\_LOGGING\_DSN setting located in civicrm.settings.php? We are using Drupal.
  
  I have successfully used the following to change some settings before:
  
  `Civi::settings()->set('customPHPPathDir', "$root/CustomPHP/");`
  
  Thanks for any help!
  
  **Tags:** civicrm.settings.php, drush, aegir
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-02-18. Score: 1 | Accepted answer
  
  It's not a setting you can set with Civi::settings. You can set it with a define() anywhere outside of civicrm.settings.php, but it would need to run that section in your file before running the code where it gets used, so somewhere pretty early in a page run. It always falls back to CIVICRM\_DSN if CIVICRM\_LOGGING\_DSN is not set, if your setting runs too late.
  
  > **Comments:**
  > **username_0**: Just to make sure I understand. Would it need to get called every single time before civicrm.settings.php (before a Civi page is even starting to load)? If that is the case, maybe a drupal hook would work?  
  > **username_1**: Yes that might work if the drupal module has a higher weight than the civicrm module (e.g. the weight field in the drupal system table in drupal 7).  
  > **username_1**: I mean lower weight, oops. See https://www.drupal.org/docs/7/creating-custom-modules/howtos/how-to-update-a-modules-weight  
  
  ---
  
  