private function message($msg, $def = ""){
    if ($def && !isset($msg[$def])) {
      $msg[$def] = array();
    }
    if ($def && empty($msg[$def])) {
      $msg[$def] = (object)$msg[$def];
    }

    if (!isset($msg["context"])) {
      $msg["context"] = array();
    }
    $msg["context"] = array_merge($this->getDefaultContext(), $msg["context"]);

    if (!isset($msg["timestamp"])) {
      $msg["timestamp"] = null;
    }
    $msg["timestamp"] = $this->formatTime($msg["timestamp"]);
    $msg["messageId"] = self::messageId();

    return $msg;
  }