public static function formatMDC ($ctxData) {
    if ($ctxData) {
      // add context data as a series of space separated key=value pairs
      $stack = array();
      foreach ($ctxData as $key => $value) {
        $stack[] = "{$key}={$value}";
      }
      $ctx = implode(' ', $stack);
    } else {
      $ctx = '';
    }

    return $ctx;
  }