title: Converting the javascript object to json object
body: <p>I am creating a object of logMessage.</p>
  
  <pre><code>logMessage = function (msg, severity, vendorId, userName, actionPerformed, priority, traceId, dataSent) {
      this.message = msg;
      this.severity = severity;
      this.vendorId = vendorId;
      this.userName = userName;
      this.actionPerformed = actionPerformed;
      this.priority = priority;
      this.traceId = traceId;
      this.dataSent = dataSent;
  };
  
  var msg = new logMessage(err, "High", "none", qry.username, "Error on login call: /req/login", "high", "", qry);
  Utility.writeToLoggly(msg);
  </code></pre>
  
  <p><code>err ,qry</code> are json objects; How do I convert the the msg object to json object ?
  I am sending the <code>msg</code> object to <code>loggly</code> for the log management. It would be great if I could send the correctly formated json object to <code>loggly</code> .</p>