protected function getPriorityId()
    {
        $name     = !$this->priority ? 'medium' : $this->priority;
        $priority = LogPriorities::where('name', $name)->first();
        if (is_null($priority)) {
            throw new Exception(sprintf("Unable to find log priority %s.", $name));
        }
        return $priority->id;
    }