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

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

本文整理了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

  1. @Override
  2. public void afterPropertiesSet() {
  3. if (casLoginUrl == null) {
  4. if (casUrl == null) {
  5. logger.warn("casLoginUrl and casUrl are null, URLs via CAS will not be available");
  6. } else {
  7. casLoginUrl = casUrl + "/login?service=%s";
  8. }
  9. }
  10. }

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

  1. /**
  2. * @return typeClass
  3. */
  4. public Class< ? > getTypeClass() {
  5. if (typeClass == null) {
  6. try {
  7. typeClass = Class.forName(typeClassString);
  8. return typeClass;
  9. } catch (ClassNotFoundException e) {
  10. log.warn("la classe " + typeClassString + " n'existe pas");
  11. return null;
  12. }
  13. }
  14. return typeClass;
  15. }

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

  1. /**
  2. * @return the client.
  3. */
  4. protected InetAddress getClient() {
  5. //TODO CL V2 : don't use xfire in esup-commons V2
  6. //HttpServletRequest request = XFireServletController.getRequest();
  7. // if (request == null) {
  8. // logger.warn("could not get the incoming request");
  9. // return null;
  10. // }
  11. //String remoteAddr = request.getRemoteAddr();
  12. String remoteAddr = null;
  13. if (remoteAddr == null) {
  14. logger.warn("could not get the remote address");
  15. return null;
  16. }
  17. try {
  18. return InetAddress.getByName(remoteAddr);
  19. } catch (UnknownHostException e) {
  20. return null;
  21. }
  22. }

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

  1. if (servletCasLoginUrl == null) {
  2. if (servletUrl == null) {
  3. logger.warn(
  4. "servletCasLoginUrl and servletUrl are null, "
  5. + "servlet URLs for CAS users will not be available");
  6. logger.warn(
  7. "servletShibbolethLoginUrl and servletUrl are null, "
  8. + "servlet URLs for Shibboleth users will not be available");
  9. logger.warn(
  10. "servletGuestUrl and servletUrl are null, "
  11. + "servlet URLs for application users will not be available");

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

  1. /**
  2. * @param request
  3. * @return All the attributes of the current request.
  4. */
  5. @SuppressWarnings("unchecked")
  6. private static Map<String, Object> getRequestAttributes(final HttpServletRequest request) {
  7. Map<String, Object> attributes = new Hashtable<String, Object>();
  8. if (request != null) {
  9. Enumeration<String> names = request.getAttributeNames();
  10. while (names.hasMoreElements()) {
  11. String name = names.nextElement();
  12. Object obj = request.getAttribute(name);
  13. if (obj != null) {
  14. attributes.put(name, obj);
  15. }
  16. }
  17. } else {
  18. LOG.warn("no request, can not get request attributes");
  19. }
  20. return attributes;
  21. }

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

  1. /**
  2. * @param request
  3. * @return All the attributes of the current session.
  4. */
  5. @SuppressWarnings("unchecked")
  6. private static Map<String, Object> getSessionAttributes(
  7. final HttpServletRequest request) {
  8. Map<String, Object> attributes = new Hashtable<String, Object>();
  9. HttpSession session = request.getSession(true);
  10. if (session != null) {
  11. Enumeration<String> names = session.getAttributeNames();
  12. while (names.hasMoreElements()) {
  13. String name = names.nextElement();
  14. Object obj = session.getAttribute(name);
  15. if (obj != null) {
  16. attributes.put(name, obj);
  17. }
  18. }
  19. } else {
  20. LOG.warn("no session, can not get session attributes");
  21. }
  22. return attributes;
  23. }

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

  1. @Override
  2. public void afterPropertiesSet() {
  3. if (authorizedClientNames == null || authorizedClientNames.isEmpty()) {
  4. authorizedClientNames = null;
  5. logger.warn("property authorizedClients is not set, no access control will be done.");
  6. }
  7. if (logger.isDebugEnabled()) {
  8. for (String authorizedClientName : authorizedClientNames) {
  9. logger.debug("authorized client: " + authorizedClientName);
  10. }
  11. }
  12. }

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

  1. @Override
  2. public void afterPropertiesSet() {
  3. super.afterPropertiesSet();
  4. Assert.notNull(uportalFunctionnalName, "property uportalFunctionnalName of class "
  5. + this.getClass().getName() + " can not be null");
  6. if (uportalLoginUrl == null) {
  7. if (uportalUrl == null) {
  8. logger.warn(
  9. "uportalLoginUrl and uportalUrl are null, "
  10. + "uPortal URLs for CAS users and Shibboleth will not be available");
  11. } else {
  12. uportalLoginUrl = uportalUrl + "/Login";
  13. }
  14. }
  15. if (uportalGuestUrl == null) {
  16. if (uportalUrl == null) {
  17. logger.warn(
  18. "uportalGuestUrl and uportalUrl are null, "
  19. + "uPortal URLs for application users will not be available");
  20. } else {
  21. uportalGuestUrl = uportalUrl + "/Guest";
  22. }
  23. }
  24. }

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

  1. /**
  2. * Check if the client is authorized.
  3. * @throws ConfigException
  4. */
  5. protected void checkClient() throws ConfigException {
  6. if (authorizedClientNames == null) {
  7. logger.warn("no access control on web services calls, potential security hole!");
  8. return;
  9. }
  10. InetAddress client = getClient();
  11. if (client == null) {
  12. throw new WebServiceAuthorizationException(
  13. "could not resolve the client of the web service");
  14. }
  15. for (String authorizedClientName : authorizedClientNames) {
  16. try {
  17. if (client.equals(InetAddress.getByName(authorizedClientName))) {
  18. return;
  19. }
  20. } catch (UnknownHostException e) {
  21. logger.warn("could not resolve authorized client [" + authorizedClientName + "]");
  22. }
  23. }
  24. throw new WebServiceAuthorizationException(
  25. "client [" + client.getHostName() + "] is not authorized");
  26. }

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

  1. /**
  2. * @param request
  3. * @return All the attributes of the current session.
  4. */
  5. @SuppressWarnings("unchecked")
  6. private static Map<String, Object> getSessionAttributes(
  7. final PortletRequest request) {
  8. Map<String, Object> attributes = new Hashtable<String, Object>();
  9. PortletSession session = request.getPortletSession(true);
  10. if (session != null) {
  11. Enumeration<String> names = session.getAttributeNames();
  12. while (names.hasMoreElements()) {
  13. String name = names.nextElement();
  14. Object obj = session.getAttribute(name);
  15. if (obj != null) {
  16. attributes.put(name, obj);
  17. }
  18. }
  19. } else {
  20. LOG.warn("no session, can not get session attributes");
  21. }
  22. return attributes;
  23. }

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

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

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

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

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

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

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

  1. @Override
  2. public void beforePhase(final PhaseEvent event) {
  3. if (logger.isDebugEnabled()) {
  4. logger.debug("enterig RessourceBundlePhaseListener::beforePhase = " + event);
  5. }
  6. FacesContext context = event.getFacesContext();
  7. try {
  8. Locale locale = (Locale) ContextUtils.getSessionAttribute(AbstractI18nAwareBean.LOCALE_ATTRIBUTE);
  9. if (locale == null && context.getViewRoot() != null) {
  10. locale = context.getViewRoot().getLocale();
  11. }
  12. if (locale != null
  13. && context.getExternalContext().getRequestMap().get(DEFAULT_STRINGVAR) == null) {
  14. I18nService i18nService = (I18nService) BeanUtils.getBean("i18nService");
  15. context.getExternalContext().getRequestMap().put(
  16. DEFAULT_STRINGVAR,
  17. i18nService.getStrings(locale));
  18. }
  19. } catch (NoRequestBoundException e) {
  20. //do nothing
  21. logger.warn("in ResourceBundlePhaseListener::beforePhase NoRequestBoundException");
  22. }
  23. }

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

  1. @Override
  2. public void beforePhase(final PhaseEvent event) {
  3. if (logger.isDebugEnabled()) {
  4. logger.debug("enterig RessourceBundlePhaseListener::beforePhase = " + event);
  5. }
  6. FacesContext context = event.getFacesContext();
  7. try {
  8. Locale locale = (Locale) ContextUtils.getSessionAttribute(AbstractI18nAwareBean.LOCALE_ATTRIBUTE);
  9. if (locale == null && context.getViewRoot() != null) {
  10. locale = context.getViewRoot().getLocale();
  11. }
  12. if (locale != null
  13. && context.getExternalContext().getRequestMap().get(DEFAULT_STRINGVAR) == null) {
  14. TagsConfigurator tagsConfigurator = TagsConfigurator.getInstance();
  15. context.getExternalContext().getRequestMap().put(
  16. DEFAULT_STRINGVAR,
  17. tagsConfigurator.getStrings(locale));
  18. }
  19. } catch (NoRequestBoundException e) {
  20. //do nothing
  21. logger.warn("in ResourceBundlePhaseListener::beforePhase NoRequestBoundException");
  22. }
  23. }

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

  1. /**
  2. * Log a text report.
  3. * @param t
  4. * @param textReport
  5. */
  6. protected void logTextReport(final Throwable t, final String textReport) {
  7. if (SimpleExceptionServiceFactoryImpl.ERROR.equals(logLevel.toLowerCase())) {
  8. logger.error(textReport);
  9. } else if (SimpleExceptionServiceFactoryImpl.WARN.equals(logLevel.toLowerCase())) {
  10. logger.error(ExceptionUtils.getShortPrintableStackTrace(t));
  11. logger.warn(textReport);
  12. } else if (SimpleExceptionServiceFactoryImpl.INFO.equals(logLevel.toLowerCase())) {
  13. logger.error(ExceptionUtils.getShortPrintableStackTrace(t));
  14. logger.info(textReport);
  15. } else if (SimpleExceptionServiceFactoryImpl.TRACE.equals(logLevel.toLowerCase())) {
  16. logger.error(ExceptionUtils.getShortPrintableStackTrace(t));
  17. if (logger.isTraceEnabled()) {
  18. logger.trace(textReport);
  19. }
  20. } else {
  21. logger.error(ExceptionUtils.getShortPrintableStackTrace(t));
  22. if (logger.isDebugEnabled()) {
  23. logger.debug(textReport);
  24. }
  25. }
  26. }

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

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

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

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

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

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

相关文章