public function format(LogMessageInterface $logMessage)
    {

        // initialize the parameters for the formatted message
        $params = array(
            date($this->dateFormat),
            gethostname(),
            $logMessage->getLevel(),
            $this->convertToString($logMessage),
            json_encode($logMessage->getContext())
        );

        // format, trim and return the message
        return trim(vsprintf($this->messageFormat, $params));
    }