title: printing all avalilabe info in observer object Magento
body: <p>I want to print all available information in the observer object,</p>
  
  <p>Suppose I have a event in app/local/Namespace/Modulename/etc/config.xml:</p>
  
  <p><strong>Config.xml</strong> :</p>
  
  <pre><code>&lt;checkout_cart_product_add_after&gt;
                  &lt;observers&gt;
                      &lt;namespace_modulename_checkout_cart_product_add_after_observer&gt;
                          &lt;type&gt;singleton&lt;/type&gt;
                          &lt;class&gt;Namespace_Modulename_Model_Observer&lt;/class&gt;
                          &lt;method&gt;onAddToCart&lt;/method&gt;
                      &lt;/namespace_modulename_checkout_cart_product_add_after_observer&gt;
                  &lt;/observers&gt;
              &lt;/checkout_cart_product_add_after&gt;
  </code></pre>
  
  <p>This event will call the function onAddToCart in Observer.php:
  This event successfully calls the funtion.
  <strong>Observer.php:</strong></p>
  
  <pre><code>public function onAddToCart(Varien_Event_Observer $observer)
      {
          $product = $observer-&gt;getEvent()-&gt;getProduct();
  
          $name = $product-&gt;getName();
          $sku = $product-&gt;getSku();
          Mage::log(
              "{$name} ({$sku}) updated",
              null,
              'product-updates.log'
          );
      }
  </code></pre>
  
  <p>What I wanna do in onAddToCart function is something like this:</p>
  
  <pre><code>public function onAddToCart(Varien_Event_Observer $observer)
      {
          $test4 = var_dump($observer-&gt;getDataObject()-&gt;getData());
          Mage::log(
              "{$test4}",
              null,
              'product-updates.log'
          );
      }
  </code></pre>
  
  <p><strong>Problem:</strong>
  When I do </p>
  
  <pre><code>$test4 = var_dump($observer-&gt;getDataObject()-&gt;getData());
              Mage::log(
                  "{$test4}",
                  null,
                  'product-updates.log'
              );
  </code></pre>
  
  <p>I get this error in system.log file:</p>
  
  <pre><code>Notice: Array to string conversion  in /opt/lampp/htdocs/magento2/app/code/local/Namespace/Modulename/Model/Observer.php on line 62
  </code></pre>
  
  <p>And it doesn't print anything using var_dump function,
  what I want is that all info available in the observer object gets printed automatically, like an array gets printed using print_r, but I have tried var_dump as well as print_r with no success on $observer object.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Edit: With print_r instead of var_dump,</p>
  
  <pre><code>$test4 = print_r($observer-&gt;getDataObject()-&gt;getData(), true);
  Mage::log(
      "{$test4}",
      null,
      'product-updates.log'
  );
  </code></pre>
  
  <p>Still doesn't work.</p>