private static String getParam (Properties params, String toGet, boolean required, String def) {
        String res = params.getProperty(toGet);
        if (res == null) {
            if (required) {
                throw new IllegalStateException(toGet + ERROR_NO_PARAM);
            } else {
                if (__log != null) {
                    __log.warn(toGet + WARNING_PARAM_DEFAULT);
                }
                res = def;
            }
        }

        if (__log != null) {
            __log.debug(toGet+ ": " + res);
        }

        return res;
    }