public function writeLogMessage(IncrementalOutputReceivedEvent $event)
    {
        // Get the project.
        $project = $event->getProject();

        // Get the process.
        $process = $event->getProcess();

        // Get the incremental output.
        $incrementalOutput = $event->getIncrementalOutput();

        // Get the current command.
        $command = $process->getCommandLine();

        // Create the filename.
        $filename = sprintf('%s%s.project.log', $this->logPath, strtolower($project->getName()));

        // Define the timestamp.
        $dateTime = new \DateTime();
        $timestamp = $dateTime->format('Y-m-d H:i:s');

        $fs = new Filesystem();

        if (!isset($this->lastCommand[$project->getName()]) || $this->lastCommand[$project->getName()] != $command) {
            if (file_exists($filename) && file_get_contents($filename) != '') {
                $fs->appendToFile($filename, "\n");
            }

            // Add the command executed.
            $fs->appendToFile(
                $filename,
                sprintf(
                    '[%s][Command]: %s'."\n" . '[%s][Command output]:' . "\n",
                    $timestamp,
                    $command,
                    $timestamp
                )
            );
        }

        // Add the incremental output received.
        $fs->appendToFile(
            $filename,
            sprintf('%s' . "\n", $incrementalOutput)
        );

        // Save the command executed as last command.
        $this->lastCommand[$project->getName()] = $process->getCommandLine();
    }