Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8068353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:39:23+00:00 2026-06-05T12:39:23+00:00

Mage::log works fine for me, except when it comes to printing array info. For

  • 0

Mage::log works fine for me, except when it comes to printing array info.

For example, if I have an array $result, and do this:

Mage::log(‘[CartController: getDeliverLeadTime(country): ‘ . $result . ‘)’);

In my system.log file I just get:
[CartController: getDeliverLeadTime~(country): Array)

*I want it to print the actual structure and contents of the array, as a normal print_r would do.*

If I do a var_dump of the array I get nothing, i.e. [CartController: getDeliverLeadTime~(country): ).

If I do a print_r I get:
[CartController: getDeliverLeadTime~(country): 1)

This is a blocker for me as I can’t debug what I need to – if anyone could shed any light on how to get Magento to actually print the contents of arrays in the logs, would be much appreciated.

I read on alanstorm.com that its meant to be happen by default, but its not for me.

Thanks
Paul

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:39:26+00:00Added an answer on June 5, 2026 at 12:39 pm

    You have to return print_r as a string, so print_r($result, true) should do the trick.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple question. Why doesn't Mage::log work in an Adminhtml block?? I
I have just started experiencing this problem: The site is fine until I add
Let's say I have a collection like: $products = Mage::getModel('catalog/product') ->getCollection() ... ->load(); How
> return $this->_prepareDownloadResponse( > 'invoice'.Mage::getSingleton('core/date')->date('Y-m-d_H-i-s').'.pdf', > $pdf->render(), 'application/pdf' Is it still possible to force
When using Magentos log facility Mage::log() it sometimes causes a white screen. No error
For example I need to retrieve a value from this session. How should I
I'm successfully running this query: $_productCollection = Mage::getResourceModel('reports/product_collection') ->addAttributeToSelect('*') ->setOrder('created_at', 'desc') ->setPage(1, 5); but
I have this problem with Headers already sent with Magento. I get this error:
After having written a few helper classes in magento, now i have this problem,
Why IE not showing BG mage like firefox in Iframe? I do not have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.