Answers.Body: <p>Just yesterday master updated pear/log to 1.14. See <a href="https://github.com/civicrm/civicrm-core/pull/30520" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/30520</a>. Use CRM_Core_Error::generateLogFileName() in 5.76+</p>
  <p>I also just put up a PR for the logviewer extension and earlier today for <code>cv</code>. I expect when the demo rebuilds logviewer will stop working there.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-21T15:57:56.577Z
Answers.Text: Indeed, I discovered that pear/log was at 1.14 and it seemed to be the reason why logviewer stopped working. I cheated and copied pear/log 1.13.x to my test location, and now logviewer works.
Answers.UserDisplayName: Stephen Palmstrom
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-07-29T00:42:27.073Z
Answers.Text: There's a new release of logviewer with an update for this now.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-21T15:37:14.273Z
Answers.LastActivityDate: 2024-06-21T15:37:14.273Z
Answers.UserDisplayName: Demerit
Body: <pre><code> $file_log = CRM_Core_Error::createDebugLogger();
   $logFileName = $file_log-&gt;_filename;
  </code></pre>
  <p>under 5.74.4 gives the current log file.</p>
  <p>Under my instance 5.76.alpha1 it <code>$logFileName</code> is null.</p>
  <p>This is because $file_log-&gt;_filename does not exist, it is $file_log-&gt;filename, which is private and cannot be retrieved.</p>
  <p>Log viewer, which uses this, appears to be working in the Demo environment.</p>
  <p>I'm not sure this is the right place to be raising this, but I'm not sure where else to do it.</p>
  
Tags: <error><core><logging>
Title: Cannot get filename from CRM_Core_Error::createDebugLogger() under 5.76.alpha1
ThreadText: # Cannot get filename from CRM_Core_Error::createDebugLogger() under 5.76.alpha1
  
  (Asked by: username_0 on 2024-06-21)
  
  ```
   $file_log = CRM_Core_Error::createDebugLogger();
   $logFileName = $file_log->_filename;
  
  ```
  
  under 5.74.4 gives the current log file.
  
  Under my instance 5.76.alpha1 it `$logFileName` is null.
  
  This is because $file\_log->\_filename does not exist, it is $file\_log->filename, which is private and cannot be retrieved.
  
  Log viewer, which uses this, appears to be working in the Demo environment.
  
  I'm not sure this is the right place to be raising this, but I'm not sure where else to do it.
  
  **Tags:** error, core, logging
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-06-21. Score: 0
  
  Just yesterday master updated pear/log to 1.14. See <https://github.com/civicrm/civicrm-core/pull/30520>. Use CRM\_Core\_Error::generateLogFileName() in 5.76+
  
  I also just put up a PR for the logviewer extension and earlier today for `cv`. I expect when the demo rebuilds logviewer will stop working there.
  
  > **Comments:**
  > **username_0**: Indeed, I discovered that pear/log was at 1.14 and it seemed to be the reason why logviewer stopped working. I cheated and copied pear/log 1.13.x to my test location, and now logviewer works.  
  > **username_1**: There's a new release of logviewer with an update for this now.  
  
  ---
  
  