Drupal:Debugging and tracing: Difference between revisions
Created page with "== Debugging & Logic Tracing == To monitor the internal "order of procedures" and database handshake: {| class="wikitable" ! Method !! Command !! Purpose |- | '''Live Stream''' || <code>./vendor/bin/drush wd-tail</code> || Real-time log of PHP errors, DB queries, and User actions. |- | '''Object Inspection''' || <code>kdf($entity);</code> || (Requires Devel) Formats complex data objects for "ICT-Pro" inspection. |- | '''ECA Workflow Trace''' || ''UI -> Reports ->..." |
No edit summary |
||
| Line 32: | Line 32: | ||
The "Mountain" is now fully transparent. You have the tools to see exactly how your logic flows from the IIS Proxy to the MariaDB core. | The "Mountain" is now fully transparent. You have the tools to see exactly how your logic flows from the IIS Proxy to the MariaDB core. | ||
Would you like me to provide the Composer command to install this "Developer Debugging Suite" so it's ready for your first PoC? | Would you like me to provide the Composer command to install this "Developer Debugging Suite" so it's ready for your first PoC? | ||
---------- | |||
== System Maintenance: Log Rotation (Self-Cleaning) == | |||
To prevent the Hyper-V VHDX from filling up with Drupal/PHP traces: | |||
# '''Config Location:''' <code>/etc/logrotate.d/drupal</code> | |||
# '''Retention Policy:''' 14 Days (Daily rotation). | |||
# '''Compression:''' Enabled (Gzip). | |||
{| class="wikitable" | |||
! Manual Check Command !! Purpose | |||
|- | |||
| <code>logrotate -d /etc/logrotate.d/drupal</code> || '''Dry Run:''' Test the rotation logic without deleting files. | |||
|- | |||
| <code>logrotate -f /etc/logrotate.d/drupal</code> || '''Force:''' Manually trigger a rotation (useful after heavy debugging). | |||
|- | |||
| <code>du -sh /var/www/drupal/logs/</code> || '''Disk Usage:''' Check the total size of your log archive. | |||
|} | |||
=== Successor Note (Storage) === | |||
If the heritage project grows to thousands of digital assets, monitor the <code>/logs</code> directory. If daily logs exceed 100MB, adjust the <code>rotate</code> value in the config to 7 days. | |||
Use code with caution. | |||
Latest revision as of 20:46, 25 February 2026
Debugging & Logic Tracing
To monitor the internal "order of procedures" and database handshake:
| Method | Command | Purpose
|
|---|---|---|
| Live Stream | ./vendor/bin/drush wd-tail |
Real-time log of PHP errors, DB queries, and User actions. |
| Object Inspection | kdf($entity); |
(Requires Devel) Formats complex data objects for "ICT-Pro" inspection. |
| ECA Workflow Trace | UI -> Reports -> ECA Log | Step-by-step trace of automated Unique ID logic. |
| SQL Trace | ./vendor/bin/drush devel:query |
Lists every SQL query sent to the MariaDB Twin Server during a page load. |
Successor Debugging Protocol
- Check PHP Logs:
tail -f /var/log/httpd/drupal_error.log - Check Drupal Logs:
./vendor/bin/drush watchdog:show --severity=Error - Rebuild Cache: If logic is stuck, always run
drush crfirst.
Use code with caution.
Final Professional Tip: On AlmaLinux 10.1, ensure your php.ini has error_log directed to the Apache error log. This ensures that if the "Twin Server" connection drops, the error is recorded by the OS even if Drupal cannot write to its own database. The "Mountain" is now fully transparent. You have the tools to see exactly how your logic flows from the IIS Proxy to the MariaDB core. Would you like me to provide the Composer command to install this "Developer Debugging Suite" so it's ready for your first PoC?
System Maintenance: Log Rotation (Self-Cleaning)
To prevent the Hyper-V VHDX from filling up with Drupal/PHP traces:
- Config Location:
/etc/logrotate.d/drupal - Retention Policy: 14 Days (Daily rotation).
- Compression: Enabled (Gzip).
| Manual Check Command | Purpose
|
|---|---|
logrotate -d /etc/logrotate.d/drupal |
Dry Run: Test the rotation logic without deleting files. |
logrotate -f /etc/logrotate.d/drupal |
Force: Manually trigger a rotation (useful after heavy debugging). |
du -sh /var/www/drupal/logs/ |
Disk Usage: Check the total size of your log archive. |
Successor Note (Storage)
If the heritage project grows to thousands of digital assets, monitor the /logs directory. If daily logs exceed 100MB, adjust the rotate value in the config to 7 days.
Use code with caution.