Answers.Body: <p>Found it!</p>
  
  <p>The log file is named by <code>CRM_Exception::generateLogFileName($prefix);</code>  in <code>civicrm/CRM/Core/Error.php</code>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-01T06:41:36.223Z
Answers.Text: I tried to make this into a `cv` command and failed. I got as far as `
  cv ev "CRM_Exception::createDebugLogger(); return \Civi::$statics['CRM_Core_Error']['logger_file'];"` but alas it just returned false :-/
Answers.UserDisplayName: ErichBSchulz
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-01T06:40:36.530Z
Answers.LastActivityDate: 2017-03-01T06:40:36.530Z
Answers.UserDisplayName: ErichBSchulz
Answers.Body: <p>Based on your comment,</p>
  
  <pre><code>cv ev 'CRM_Core_Error::createDebugLogger(); return \Civi::$statics['CRM_Core_Error']['logger_file'];'
  </code></pre>
  
  <ul>
  <li>Might run into trouble with bash treating the square brackets as wildcards when using double quotes as above?</li>
  <li><code>CRM_Core_Error</code> not <code>CRM_Exception</code> worked for me.</li>
  </ul>
  
  <p>Not sure what you're using this for, but an easier path might be to use wildcards. When developing I tend to just</p>
  
  <pre><code>tail -f sites/*/files/civicrm/ConfigAndLog/*log
  </code></pre>
  
  <p>and similar when collecting logfiles to some central service.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-30T11:06:12.967Z
Answers.LastActivityDate: 2017-04-30T11:06:12.967Z
Answers.UserDisplayName: Chris Burgess
Body: <p>In the <a href="https://civicrm.org/blog/totten/the-static-is-dead-long-live-the-static" rel="nofollow noreferrer">latest awesome pattern</a> we can now locate our log service easily:</p>
  
  <pre><code>Civi::log()-&gt;info('Hello, log!');
  </code></pre>
  
  <p>And then we can <a href="https://civicrm.stackexchange.com/questions/16365/monitor-configandlog-log-file-in-real-time">tail the log</a> which is in our <code>ConfigAndLog</code> directory. Chris has enumerated <a href="https://civicrm.stackexchange.com/questions/6399/how-do-i-debug-civicrm-when-i-hit-a-blank-page-white-screen-fatal-error">the other log files around</a> and Jon has described <a href="https://civicrm.stackexchange.com/questions/15931/where-are-the-configandlog-and-templates-c-directories">where to find the directory in different CMS's</a> but I need to have a one liner to point me directly at the current log file.</p>
  
  <p>For me, right this second, it is:</p>
  
  <p><code>/opt/buildkit/build/dmaster/sites/default/files/civicrm/ConfigAndLog/CiviCRM.e6449e3815b7721f267195e2.log
  </code></p>
  
  <p>How do I find this next time without having to go hunting around? Ideally I'm after a <code>cv</code> based one-liner.</p>
  
Tags: <php><logs><debugging>
Title: Where is the exact path to the ConfigAndLog log *file*?
ThreadText: # Where is the exact path to the ConfigAndLog log *file*?
  
  (Asked by: username_0 on 2017-02-04)
  
  In the [latest awesome pattern](https://civicrm.org/blog/totten/the-static-is-dead-long-live-the-static) we can now locate our log service easily:
  
  ```
  Civi::log()->info('Hello, log!');
  
  ```
  
  And then we can [tail the log](https://civicrm.stackexchange.com/questions/16365/monitor-configandlog-log-file-in-real-time) which is in our `ConfigAndLog` directory. username_1 has enumerated [the other log files around](https://civicrm.stackexchange.com/questions/6399/how-do-i-debug-civicrm-when-i-hit-a-blank-page-white-screen-fatal-error) and Jon has described [where to find the directory in different CMS's](https://civicrm.stackexchange.com/questions/15931/where-are-the-configandlog-and-templates-c-directories) but I need to have a one liner to point me directly at the current log file.
  
  For me, right this second, it is:
  
  `/opt/buildkit/build/dmaster/sites/default/files/civicrm/ConfigAndLog/CiviCRM.e6449e3815b7721f267195e2.log`
  
  How do I find this next time without having to go hunting around? Ideally I'm after a `cv` based one-liner.
  
  **Tags:** php, logs, debugging
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2017-03-01. Score: 1
  
  Found it!
  
  The log file is named by `CRM_Exception::generateLogFileName($prefix);` in `civicrm/CRM/Core/Error.php`.
  
  > **Comments:**
  > **username_0**: I tried to make this into a `cv` command and failed. I got as far as ` cv ev "CRM_Exception::createDebugLogger(); return \Civi::$statics['CRM_Core_Error']['logger_file'];"` but alas it just returned false :-/  
  
  ---
  
  ### Answer by username_1 on 2017-04-30. Score: 0
  
  Based on your comment,
  
  ```
  cv ev 'CRM_Core_Error::createDebugLogger(); return \Civi::$statics['CRM_Core_Error']['logger_file'];'
  
  ```
  
  * Might run into trouble with bash treating the square brackets as wildcards when using double quotes as above?
  * `CRM_Core_Error` not `CRM_Exception` worked for me.
  
  Not sure what you're using this for, but an easier path might be to use wildcards. When developing I tend to just
  
  ```
  tail -f sites/*/files/civicrm/ConfigAndLog/*log
  
  ```
  
  and similar when collecting logfiles to some central service.
  
  
  ---
  
  