Answers.Body: <p>You may want to try this:</p>
  <ul>
  <li>CiviCRM logs (in ConfigAndLogs folder)</li>
  <li>PHP/webserver logs ( error logs specifically )</li>
  <li>an extension &quot;api&quot; folder: there should be a &quot;Job&quot; folder - to read a code</li>
  <li>an extension main php file - if the &quot;api&quot; folder contains no code</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-09-01T10:13:03.133Z
Answers.LastActivityDate: 2023-09-01T10:13:03.133Z
Answers.UserDisplayName: yurg
Answers.Body: <p>If the logs aren't informative and you can reproduce the issue locally, then you can debug the extension with a debugger in the same way as <a href="https://docs.civicrm.org/dev/en/latest/tools/debugging/#running-a-debugger-program" rel="nofollow noreferrer">you'd debug core</a>.</p>
  <p>But the logs should definitely be your first stop. The <a href="https://civicrm.org/extensions/civicrm-log-viewer" rel="nofollow noreferrer">Log Viewer</a> extension is a convenient way to check the CiviCRM ones.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-09-01T18:35:07.917Z
Answers.LastActivityDate: 2023-09-01T18:35:07.917Z
Answers.UserDisplayName: Lars SG
Body: <p>We have an extension (home-baked so long ago that it can be considered legacy, meaning no-one knows enough about it) implementing a job that has started to hang on execution.</p>
  <p>I can run the job from the API and get the same behaviour. What would be my next steps towards debugging this issue?</p>
  <p>Logs? Pointers to set up for debugging CiviCRM extensions?</p>
  
Tags: <scheduled-job><debug>
Title: How to debug hanging job?
ThreadText: # How to debug hanging job?
  
  (Asked by: username_0 on 2023-09-01)
  
  We have an extension (home-baked so long ago that it can be considered legacy, meaning no-one knows enough about it) implementing a job that has started to hang on execution.
  
  I can run the job from the API and get the same behaviour. What would be my next steps towards debugging this issue?
  
  Logs? Pointers to set up for debugging CiviCRM extensions?
  
  **Tags:** scheduled-job, debug
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2023-09-01. Score: 2
  
  You may want to try this:
  
  * CiviCRM logs (in ConfigAndLogs folder)
  * PHP/webserver logs ( error logs specifically )
  * an extension "api" folder: there should be a "Job" folder - to read a code
  * an extension main php file - if the "api" folder contains no code
  
  
  ---
  
  ### Answer by username_2 on 2023-09-01. Score: 1
  
  If the logs aren't informative and you can reproduce the issue locally, then you can debug the extension with a debugger in the same way as [you'd debug core](https://docs.civicrm.org/dev/en/latest/tools/debugging/#running-a-debugger-program).
  
  But the logs should definitely be your first stop. The [Log Viewer](https://civicrm.org/extensions/civicrm-log-viewer) extension is a convenient way to check the CiviCRM ones.
  
  
  ---
  
  