Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thanks to cathulhu's input, thanks very much, I got this work with the below</p> <pre><code> // Array of db columns $paypalLog = array('transactionId' =&gt; 'transactionId', 'transactionType' =&gt; 'transactionType', 'paymentType' =&gt; 'paymentType', 'orderTime' =&gt; 'orderTime', 'amt' =&gt; 'amt', 'currencyCode' =&gt; 'currencyCode', 'feeAmt' =&gt; 'feeAmt', 'taxAmt' =&gt; 'taxAmt', 'paymentStatus' =&gt; 'paymentStatus', 'pendingReason' =&gt; 'pendingReason', 'reasonCode' =&gt; 'reasonCode' ); // Map data into array matching column names $data = array( 'transactionId' =&gt; $transactionId, 'transactionType' =&gt; $transactionType, 'paymentType' =&gt; $paymentType, 'orderTime' =&gt; $orderTime, 'amt' =&gt; $amt, 'currencyCode' =&gt; $currencyCode, 'feeAmt' =&gt; $feeAmt, 'taxAmt' =&gt; $taxAmt, 'paymentStatus' =&gt; $paymentStatus, 'pendingReason' =&gt; $pendingReason, 'reasonCode' =&gt; $reasonCode ); // Array to construct the DB logger table structure with extra columns $mapping = array( 'timestamp' =&gt; 'timestamp', 'priority' =&gt; 'priority', 'priorityName' =&gt; 'priorityName', 'message' =&gt; 'message', 'extra' =&gt; $paypalLog); // Array to log actual data $mylog = array( 'message' =&gt; 'some msg', 'extra' =&gt; $data); // Configure the write/logger and specify the array members to log $writer = new Zend\Log\Writer\Db($db, 'paypal', $mapping); $logger = new Zend\Log\Logger(); $logger-&gt;addWriter($writer); $logger-&gt;info($mylog['message'], $mylog['extra']); </code></pre> <p>I now see this output from the MySQL general log</p> <pre><code>Connect user@localhost on database 54 Query INSERT INTO `paypal` (`timestamp`,`priority`,`priorityName`,`message`,`transactionId`,`transactionType`,`paymentType`,`orderTime`,`amt`,`currencyCode`,`feeAmt`,`taxAmt`,`paymentStatus`,`pendingReason`,`reasonCode`) VALUES ('2013-02-15T07:52:52+01:00','6','INFO','My log message','88L4229675348363C','expresscheckout','instant','2013-02-15T06:52:58Z','9.00','AUD','0.52','0.00','Completed','None','None') 54 Quit </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload