org.esupportail.commons.services.logging.Logger.warn()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(9.4k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中org.esupportail.commons.services.logging.Logger.warn()方法的一些代码示例,展示了Logger.warn()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.warn()方法的具体详情如下:
包路径:org.esupportail.commons.services.logging.Logger
类名称:Logger
方法名:warn

Logger.warn介绍

暂无

代码示例

代码示例来源:origin: org.esupportail/esup-commons2-web

@Override
public void afterPropertiesSet() {
  if (casLoginUrl == null) {
    if (casUrl == null) {
      logger.warn("casLoginUrl and casUrl are null, URLs via CAS will not be available");
    } else {
      casLoginUrl = casUrl + "/login?service=%s";
    }
  }
}

代码示例来源:origin: org.esupportail/esup-opi-domain-beans

/**
 * @return typeClass
 */
public Class< ? > getTypeClass() {
  if (typeClass == null) {
    try {
      typeClass = Class.forName(typeClassString);
      return typeClass;
    } catch (ClassNotFoundException e) {
      log.warn("la classe " + typeClassString + " n'existe pas");
      return null;
    }
  }
  return typeClass;
}

代码示例来源:origin: org.esupportail/esup-commons2-web

/**
   * @return the client.
   */
  protected InetAddress getClient() {
    //TODO CL V2 : don't use xfire in esup-commons V2
    //HttpServletRequest request = XFireServletController.getRequest();
//        if (request == null) {
//            logger.warn("could not get the incoming request");
//            return null;
//        }
    //String remoteAddr = request.getRemoteAddr();
    String remoteAddr = null;
    if (remoteAddr == null) {
      logger.warn("could not get the remote address");
      return null;
    }
    try {
      return InetAddress.getByName(remoteAddr);
    } catch (UnknownHostException e) {
      return null;
    }
  }

代码示例来源:origin: org.esupportail/esup-commons2-web

if (servletCasLoginUrl == null) {
  if (servletUrl == null) {
    logger.warn(
        "servletCasLoginUrl and servletUrl are null, "
        + "servlet URLs for CAS users will not be available");
    logger.warn(
        "servletShibbolethLoginUrl and servletUrl are null, "
        + "servlet URLs for Shibboleth users will not be available");
    logger.warn(
        "servletGuestUrl and servletUrl are null, "
        + "servlet URLs for application users will not be available");

代码示例来源:origin: org.esupportail/esup-commons2-web

/**
 * @param request
 * @return All the attributes of the current request.
 */
@SuppressWarnings("unchecked")
private static Map<String, Object> getRequestAttributes(final HttpServletRequest request) {
  Map<String, Object> attributes = new Hashtable<String, Object>();
  if (request != null) {
    Enumeration<String> names = request.getAttributeNames();
    while (names.hasMoreElements()) {
      String name = names.nextElement();
      Object obj = request.getAttribute(name);
      if (obj != null) {
        attributes.put(name, obj);
      }
    }
  } else {
    LOG.warn("no request, can not get request attributes");
  }
  return attributes;
}

代码示例来源:origin: org.esupportail/esup-commons2-web

/**
 * @param request
 * @return All the attributes of the current session.
 */
@SuppressWarnings("unchecked")
private static Map<String, Object> getSessionAttributes(
    final HttpServletRequest request) {
  Map<String, Object> attributes = new Hashtable<String, Object>();
  HttpSession session = request.getSession(true);
  if (session != null) {
    Enumeration<String> names = session.getAttributeNames();
    while (names.hasMoreElements()) {
      String name = names.nextElement();
      Object obj = session.getAttribute(name);
      if (obj != null) {
        attributes.put(name, obj);
      }
    }
  } else {
    LOG.warn("no session, can not get session attributes");
  }
  return attributes;
}

代码示例来源:origin: org.esupportail/esup-commons2-web

@Override
public void afterPropertiesSet() {
  if (authorizedClientNames == null || authorizedClientNames.isEmpty()) {
    authorizedClientNames = null;
    logger.warn("property authorizedClients is not set, no access control will be done.");
  }
  if (logger.isDebugEnabled()) {
    for (String authorizedClientName : authorizedClientNames) {
      logger.debug("authorized client: " + authorizedClientName);
    }
  }
}

代码示例来源:origin: org.esupportail/esup-commons2-web

@Override
public void afterPropertiesSet() {
  super.afterPropertiesSet();
  Assert.notNull(uportalFunctionnalName, "property uportalFunctionnalName of class "
      + this.getClass().getName() + " can not be null");
  if (uportalLoginUrl == null) {
    if (uportalUrl == null) {
      logger.warn(
          "uportalLoginUrl and uportalUrl are null, "
          + "uPortal URLs for CAS users and Shibboleth will not be available");
    } else {
      uportalLoginUrl = uportalUrl + "/Login";
    }
  }
  if (uportalGuestUrl == null) {
    if (uportalUrl == null) {
      logger.warn(
          "uportalGuestUrl and uportalUrl are null, "
          + "uPortal URLs for application users will not be available");
    } else {
      uportalGuestUrl = uportalUrl + "/Guest";
    }
  }
}

代码示例来源:origin: org.esupportail/esup-commons2-web

/**
 * Check if the client is authorized.
 * @throws ConfigException
 */
protected void checkClient() throws ConfigException {
  if (authorizedClientNames == null) {
    logger.warn("no access control on web services calls, potential security hole!");
    return;
  }
  InetAddress client = getClient();
  if (client == null) {
    throw new WebServiceAuthorizationException(
        "could not resolve the client of the web service");
  }
  for (String authorizedClientName : authorizedClientNames) {
    try {
      if (client.equals(InetAddress.getByName(authorizedClientName))) {
        return;
      }
    } catch (UnknownHostException e) {
      logger.warn("could not resolve authorized client [" + authorizedClientName + "]");
    }
  }
  throw new WebServiceAuthorizationException(
      "client [" + client.getHostName() + "] is not authorized");
}

代码示例来源:origin: org.esupportail/esup-commons2-web

/**
 * @param request
 * @return All the attributes of the current session.
 */
@SuppressWarnings("unchecked")
private static Map<String, Object> getSessionAttributes(
    final PortletRequest request) {
  Map<String, Object> attributes = new Hashtable<String, Object>();
  PortletSession session = request.getPortletSession(true);
  if (session != null) {
    Enumeration<String> names = session.getAttributeNames();
    while (names.hasMoreElements()) {
      String name = names.nextElement();
      Object obj = session.getAttribute(name);
      if (obj != null) {
        attributes.put(name, obj);
      }
    }
  } else {
    LOG.warn("no session, can not get session attributes");
  }
  return attributes;
}

代码示例来源:origin: org.esupportail/esup-opi-domain-beans

log.warn("l'attribut " + methodId + " représentant l'identifiant n'existe pas");
return null;

代码示例来源:origin: org.esupportail/esup-commons2-jsf2

} catch (NoRequestBoundException e) {
  logger.warn("in AbstractPhaseListener::debugEvent NoRequestBoundException");

代码示例来源:origin: org.esupportail/esup-commons2-jsf

} catch (NoRequestBoundException e) {
  logger.warn("in AbstractPhaseListener::debugEvent NoRequestBoundException");

代码示例来源:origin: org.esupportail/esup-commons2-jsf

@Override
public void beforePhase(final PhaseEvent event) {
  if (logger.isDebugEnabled()) {
    logger.debug("enterig  RessourceBundlePhaseListener::beforePhase = " + event);
  }
  FacesContext context = event.getFacesContext();
  try {
    Locale locale = (Locale) ContextUtils.getSessionAttribute(AbstractI18nAwareBean.LOCALE_ATTRIBUTE);
    if (locale == null && context.getViewRoot() != null) {
      locale = context.getViewRoot().getLocale();
    }
    if (locale != null
        && context.getExternalContext().getRequestMap().get(DEFAULT_STRINGVAR) == null) {
      I18nService i18nService = (I18nService) BeanUtils.getBean("i18nService");
      context.getExternalContext().getRequestMap().put(
          DEFAULT_STRINGVAR,
          i18nService.getStrings(locale));
    }
  } catch (NoRequestBoundException e) {
    //do nothing
    logger.warn("in ResourceBundlePhaseListener::beforePhase NoRequestBoundException");
  }
}

代码示例来源:origin: org.esupportail/esup-commons2-jsf2

@Override
public void beforePhase(final PhaseEvent event) {
  if (logger.isDebugEnabled()) {
    logger.debug("enterig  RessourceBundlePhaseListener::beforePhase = " + event);
  }
  FacesContext context = event.getFacesContext();
  try {
    Locale locale = (Locale) ContextUtils.getSessionAttribute(AbstractI18nAwareBean.LOCALE_ATTRIBUTE);
    if (locale == null && context.getViewRoot() != null) {
      locale = context.getViewRoot().getLocale();
    }
    if (locale != null
        && context.getExternalContext().getRequestMap().get(DEFAULT_STRINGVAR) == null) {
      TagsConfigurator tagsConfigurator = TagsConfigurator.getInstance();
      context.getExternalContext().getRequestMap().put(
          DEFAULT_STRINGVAR,
          tagsConfigurator.getStrings(locale));
    }
  } catch (NoRequestBoundException e) {
    //do nothing
    logger.warn("in ResourceBundlePhaseListener::beforePhase NoRequestBoundException");
  }
}

代码示例来源:origin: org.esupportail/esup-commons2-exceptionHandling

/**
 * Log a text report.
 * @param t
 * @param textReport
 */
protected void logTextReport(final Throwable t, final String textReport) {
  if (SimpleExceptionServiceFactoryImpl.ERROR.equals(logLevel.toLowerCase())) {
    logger.error(textReport);
  } else if (SimpleExceptionServiceFactoryImpl.WARN.equals(logLevel.toLowerCase())) {
    logger.error(ExceptionUtils.getShortPrintableStackTrace(t));
    logger.warn(textReport);
  } else if (SimpleExceptionServiceFactoryImpl.INFO.equals(logLevel.toLowerCase())) {
    logger.error(ExceptionUtils.getShortPrintableStackTrace(t));
    logger.info(textReport);
  } else if (SimpleExceptionServiceFactoryImpl.TRACE.equals(logLevel.toLowerCase())) {
    logger.error(ExceptionUtils.getShortPrintableStackTrace(t));
    if (logger.isTraceEnabled()) {
      logger.trace(textReport);
    }
  } else {
    logger.error(ExceptionUtils.getShortPrintableStackTrace(t));
    if (logger.isDebugEnabled()) {
      logger.debug(textReport);
    }
  }
}

代码示例来源:origin: org.esupportail/esup-commons2-web

out.write(data);
} catch (SocketException e) {
  logger.warn(
      "SocketException was raides while downloading, "
      + "probably because the client cancelled");

代码示例来源:origin: org.esupportail/esup-commons2-jsf

} catch (NoRequestBoundException e) {
  logger.warn("in MessagesPhaseListener::beforePhaseInternal NoRequestBoundException");

代码示例来源:origin: org.esupportail/esup-commons2-jsf2

} catch (NoRequestBoundException e) {
  logger.warn("in MessagesPhaseListener::beforePhaseInternal NoRequestBoundException");

相关文章

微信公众号

最新文章

更多