Skip to main content

How to print with style to watchdog without devel

So sometimes i want to make some development on live sites that i do not want to enable and disable the Devel module due to perfomance issues. I found from dropbucket (http://dropbucket.org/node/72) this awesome snippet that helps me a lot with "background backoffice" development. You can print arrays or objects to watchdog that looks pretty and structured too (in a more human-readable way actually)! ' . print_r( $my_array_or_object, true) . ''); ?> Have fun! p.s: Do not forget to enable the System Log module (database logging / dblog module) for that. The admin page of the module is this: admin/reports/dblog
watchdog drupal syslog