public static SyslogLevel mapStringToSyslog(String level) {
        level = level.toLowerCase().trim();
        if (level.equals("debug")) {
            return SyslogLevel.DEBUG;
        } else if (level.equals("info")) {
            return SyslogLevel.INFO;
        } else if (level.equals("notice")) {
            return SyslogLevel.NOTICE;
        } else if (level.equals("warning") || level.equals("warn")) {
            return SyslogLevel.WARNING;
        } else if (level.equals("error")) {
            return SyslogLevel.ERROR;
        } else if (level.equals("critical")) {
            return SyslogLevel.CRITICAL;
        } else if (level.equals("alert")) {
            return SyslogLevel.ALERT;
        } else if (level.equals("emergency")) {
            return SyslogLevel.EMERGENCY;
        }
        return SyslogLevel.DEBUG;
    }