title: PubNub: What is the right way to log all published message to my db
body: <p>What is the right way to log every published message and save it to my server db.</p>
  
  <p>There are two options which I can think of:</p>
  
  <ol>
  <li>Use PubNub function <em>After Publish event</em> and forward the message to a dedicated logger channel. the server will subscribe to the channel and save the arrived messages to db. <em>Here rise another question: when I forward the message to another channel in the PubNub function will it also trigger the PubNub function?</em></li>
  <li>use PubNub XHR request/response function and call to a rest API on my server with the published message and save it to db</li>
  </ol>
  
  <p><strong>What is the best practice concerning performance and cost?</strong></p>