Share icon
watchdog d7

hey, For many purpose we have to print the array or object while making a custom modules or debuging any old module, we have to print the array or object to see the values are fine or not, drupal provide a way to see those using watchdog, But how we print array or object in watchdog function, Answer is below.

watchdog("any_word_you_like", '<pre>' . print_r( $your_object_variable, true) . '</pre>');

Now, execute your function or page whenever you right it.

Then go to - https://yourdomian/admin/reports/dblog

Then go to - https://yourdomian/admin/reports/dblog

Note - Make sure module "Database logging (dblog)" is on then only you can see the above page.


Please Comment your thoughts and feedback below and add something if you found good in anywhere to help others

Hit a like Button If you like the Post.

Many Thanks

Add new comment

Restricted HTML