Answers.Body: <p>You'd have to write your own but under Administer -> System Settings -> Debugging and Error Handling you can set a classname that will handle fatal errors. However this only handles fatal errors.</p>
  
  <p>Another method is to override the CRM/Core/Error.php class. The docs don't seem to exist anymore or at least I can't find them, and I don't see it in the extensions documentation either but I think you can do this with an extension, but you can do it standalone by going to Administer -> System Settings -> Directories and specify a custom php directory, and then create a CRM/Core/Error.php under that folder (can copy the original file). Then edit that new file.</p>
  
  <p>The Log folder under packages I think is just a dependency of some of the 3rd party packages. I don't think core uses it.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-09T18:36:20.117Z
Answers.Text: Thanks @Demerit for your answer! Based on the info and insights you have given me I started building an extension: https://github.com/wannesderoy/be.calibrate.eavesdropper. Right now it's a very basic implementation, but it works well.
Answers.UserDisplayName: Wannes De Roy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-09T21:24:24.830Z
Answers.Text: Great! I'm sure others will also find the extension useful.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-10T06:40:13.247Z
Answers.Text: I did'n override the Error.php as you mentioned, but the Log.php file instead. This  looked like a much simpeler class to override and maintain. And all the logs pass through there with all the necessary data to stick them in Redis.
Answers.UserDisplayName: Wannes De Roy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-08T12:46:42.600Z
Answers.LastActivityDate: 2018-08-09T21:25:28.423Z
Answers.LastEditDate: 2018-08-09T21:25:28.423Z
Answers.UserDisplayName: Demerit
Answers.Body: <p>I created an extension that writes all the logs to Redis: <a href="https://civicrm.org/extensions/eavesdropper" rel="nofollow noreferrer">https://civicrm.org/extensions/eavesdropper</a>
  Issues, questions or feature requests can be added on github.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-22T12:08:45.227Z
Answers.LastActivityDate: 2018-08-22T12:08:45.227Z
Answers.UserDisplayName: Wannes De Roy
Body: <p>In our Drupal 8 - CiviCRM we use Redis for caching and some log management. We would like that CiviCRM also logs errors to Redis, or any other log system for that matter. Is it possible to configure/swap the log classes as is possible with cache classes?</p>
  
  <p>In <code>civicrm-core/packages/Log</code> I see there are other classes available for logging but I don't know how they are used. How would a syslog for example be used for error logs?</p>
  
  <p>Is it at all possible to use a different class for error logs or has this functionality yet to be build?</p>
  
Tags: <logs><drupal-8>
Title: Logs in CiviCRM
ThreadText: # Logs in CiviCRM
  
  (Asked by: username_0 on 2018-08-08)
  
  In our Drupal 8 - CiviCRM we use Redis for caching and some log management. We would like that CiviCRM also logs errors to Redis, or any other log system for that matter. Is it possible to configure/swap the log classes as is possible with cache classes?
  
  In `civicrm-core/packages/Log` I see there are other classes available for logging but I don't know how they are used. How would a syslog for example be used for error logs?
  
  Is it at all possible to use a different class for error logs or has this functionality yet to be build?
  
  **Tags:** logs, drupal-8
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-08-08. Score: 1 | Accepted answer
  
  You'd have to write your own but under Administer -> System Settings -> Debugging and Error Handling you can set a classname that will handle fatal errors. However this only handles fatal errors.
  
  Another method is to override the CRM/Core/Error.php class. The docs don't seem to exist anymore or at least I can't find them, and I don't see it in the extensions documentation either but I think you can do this with an extension, but you can do it standalone by going to Administer -> System Settings -> Directories and specify a custom php directory, and then create a CRM/Core/Error.php under that folder (can copy the original file). Then edit that new file.
  
  The Log folder under packages I think is just a dependency of some of the 3rd party packages. I don't think core uses it.
  
  > **Comments:**
  > **username_0**: Thanks @username_1 for your answer! Based on the info and insights you have given me I started building an extension: https://github.com/username_0/be.calibrate.eavesdropper. Right now it's a very basic implementation, but it works well.  
  > **username_1**: Great! I'm sure others will also find the extension useful.  
  > **username_0**: I did'n override the Error.php as you mentioned, but the Log.php file instead. This  looked like a much simpeler class to override and maintain. And all the logs pass through there with all the necessary data to stick them in Redis.  
  
  ---
  
  ### Answer by username_0 on 2018-08-22. Score: 4
  
  I created an extension that writes all the logs to Redis: <https://civicrm.org/extensions/eavesdropper>
  Issues, questions or feature requests can be added on github.
  
  
  ---
  
  