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

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

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

Logger.error介绍

暂无

代码示例

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

@Override
public void handleException() throws ExceptionHandlingException {
  logger.error(throwable);
  throw new ExceptionHandlingException(throwable);
}

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

/**
 * @param zipStream
 * @param fileNameCsv
 * @param map
 * @return ZipOutputStream
 */
public static ZipOutputStream prepareCSVinZip(final ZipOutputStream zipStream,
    final String fileNameCsv, final Map<Integer, List<String>> map) {
  try {
    String s = makeCvs(map);
    
    ZipEntry zipEntry = new ZipEntry(fileNameCsv);
    zipStream.putNextEntry(zipEntry);
    
    zipStream.write(s.getBytes());
    zipStream.closeEntry();
  } catch (IOException e) {
    LOGGER.error("probleme de preparation du zip contenant le csv = " 
              + fileNameCsv + "exception : " + e);
  }                         
  
  return zipStream;
}

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

/**
 * @return The client as a printable string.
 */
public static String getClientString() {
  String rawClientString = getRawClientString();
  if (rawClientString == null) {
    return null;
  }
  try {
    InetAddress client = getRealInetAddress(rawClientString);
    return new StringBuffer(client.getHostAddress())
    .append(" (").append(client.getHostName()).append(")").toString();
  } catch (UnknownHostException e) {
    LOG.error("UnknownHostException caught: " + e);
    return rawClientString;
  }
}

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

LOG.error(t);

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

zipStream.closeEntry();
} catch (TransformerException e) {
  LOGGER.error("probleme de preparation du zip contenant le pdf = "
            + fileNamePdf + "exception : " + e);
} catch (IOException e) {
  LOGGER.error("probleme de preparation du zip contenant le pdf = " 
            + fileNamePdf + "exception : " + e);
} finally {

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

/**
 * @return a safe exception service.
 */
private static ExceptionService createSafeExceptionService() {
  try {
    return new SafeExceptionServiceImpl();
  } catch (Throwable t) {
    LOGGER.error("An exception was thhrown while getting a safe implementation, giving up", t);
    throw new ExceptionHandlingException(t);
  }
}

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

@Override
public void handleException() throws ExceptionHandlingException {
  // try to log the throwable
  try {
    logTextReport(getThrowable(), getTextReport());
  } catch (Throwable t) {
    logger.error("The following error was thrown by the application:", throwable);
    logger.error("Another throwable was thrown while logging the first one (giving up):", t);
    throw new ExceptionHandlingException(t);
  }
}

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

LOGGER.error("probleme de transformation pdf = " + fileNamePdf + "exception : " + e);
} finally {
  f1.delete();

代码示例来源: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-opi-web-beans

LOGGER.error("error in instance Internet adresse for individu with numDosOpi = "+ ind.getNumDossierOpi(), e);

代码示例来源:origin: org.esupportail/ects-domain-services

/**
 * @see org.esupportail.ects.domain.DomainService#getSignataires()
 */
@Override
@Cacheable(cacheName = CacheModelConst.REF_DEFAULT_MODEL)
public SignataireWSSignataireDTO[] getSignataires() {
  if (logger.isDebugEnabled()) {
    logger.debug("entering getSignataires()");
  }
  
  SignataireWSSignataireDTO[] res = null;
  try {
    ReferentielMetierServiceInterface referentielMetierService
    =  (ReferentielMetierServiceInterface) WSUtils.getService(WSUtils.REFERENTIEL_SERVICE_NAME);
    // Recherche des signataires dans Apogee
    // recupererSignataire( _codSig, _temoinEnService)
    res = referentielMetierService.recupererSignataire("", "O");
  } catch (RemoteException e) {
    logger.error("RemoteException in getSignataires() = " + e);
    return null;
  } catch (WebBaseException e) {
    logger.error("WebBaseException in getSignataires() = " + e);
    return null;
  }
  
  return res;
}

代码示例来源:origin: org.esupportail/ects-domain-services

/**
 * @see org.esupportail.ects.domain.DomainService#getResultatsVetEtu(java.lang.String, java.lang.String)
 */
@Override
@Cacheable(cacheName = CacheModelConst.PEDA_DEFAULT_MODEL)
public ContratPedagogiqueResultatVdiVetDTO[] getResultatsVetEtu(String annee, String codEtu) {
  if (logger.isDebugEnabled()) {
    logger.debug("entering getResultatsVetEtu( " + annee + ", " + codEtu + " )");
  }
  ContratPedagogiqueResultatVdiVetDTO[] contrat;
  try {
    PedagogiqueMetierServiceInterface pedagogiqueMetierService
    =  (PedagogiqueMetierServiceInterface) WSUtils.getService(WSUtils.PEDAGOGIQUE_SERVICE_NAME);
    // Recherche les résultats de l'étudiant dans Apogee
    // recupererContratPedagogiqueResultatVdiVet(
    //		_codEtu String (8),_codAnu String (4), 
    //      _sourceRes String, _etatDelib String (max 3),
    //      _codSes String, _typeRes String)
    contrat = pedagogiqueMetierService.recupererContratPedagogiqueResultatVdiVet(codEtu, annee, "Apogee", "T", "toutes", "tous");
  } catch (RemoteException e) {
    logger.error("RemoteException in getResultatsVetEtu(" + annee + ", " + codEtu + ") = " + e);
    return null;
  } catch (WebBaseException e) {
    logger.error("WebBaseException in getResultatsVetEtu(" + annee + ", " + codEtu + ") = " + e);
    return null;
  }
  
  return contrat;

}

代码示例来源:origin: org.esupportail/ects-utils

@Override
public void exportPdfDistribEcts(Element el, FacesContext facesContext,
    String fileXsl, String fileName) {
  File xml = null;
  try {
    Document doc = new Document(el);
    xml = File.createTempFile(fileName, ".xml");
    FileWriter writer = new FileWriter(xml);
    XMLOutputter outputter = new XMLOutputter();
    Format format = outputter.getFormat();
    format.setEncoding("UTF-8");
    outputter.setFormat(format);
    outputter.output(doc, writer);
    writer.close();
    File xsl = new File(getPathXmlXsl() + fileXsl);
    byte[] contentPdf = transformXMLPDF(xml, xsl);
    setDownLoadAndSend(contentPdf, facesContext,"application/pdf", "attachment", fileName + ".pdf");
    return;
  } catch (Exception e) {
    LOGGER.error(e);
  } finally {
    if (xml != null && xml.exists()) {
      xml.delete();
    }
  }
  return;
}

代码示例来源:origin: org.esupportail/ects-domain-services

logger.error("RemoteException in getResultatsElpEtu( " 
      + annee + ", " + codEtu + ", " + codEtp + ", " + codVrsVet + " ) = " + e);
  return null;
} catch (WebBaseException e) {
  logger.error("WebBaseException in getResultatsElpEtu( " 
      + annee + ", " + codEtu + ", " + codEtp + ", " + codVrsVet + " ) = " + e);
  return null;

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

public static void setDownLoadAndSend(final byte[] data,
    final FacesContext facesContext, 
    final String contentType, 
    final String fileName) {
  
  try {
    Long id = DownloadUtils.setDownload(data, fileName, contentType);
    String url = getDownloadUrl(id);
    ExternalContext externalContext = facesContext.getExternalContext();
    externalContext.addResponseHeader("Content-Disposition", "attachment;filename=" + fileName);
    externalContext.redirect(url);
    facesContext.responseComplete();
  } catch (IOException e) {
    LOGGER.error("probleme lors de l envoie d un ficher = " + fileName + "exception : " + e);
  }
}

代码示例来源:origin: org.esupportail/ects-utils

/**
 * @param file
 * @param facesContext
 * @param contentType
 */
public void setDownLoadAndSend(final File file,
                final FacesContext facesContext,
                final String contentType,
                final String contentDisposition) {
  try {
    LOGGER.debug("DownloadUtils.setDownload(data," + contentType + "," + contentDisposition + ")");
    Long id = DownloadUtils.setDownload(file, contentType, contentDisposition);
    String url = getDownloadUrl(id);
    ExternalContext externalContext = facesContext.getExternalContext();
    externalContext.redirect(url);
    facesContext.responseComplete();
  } catch (IOException e) {
    LOGGER.error("probleme lors de l envoi d un ficher. - exception : " + e);
  }
}

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

@Override
public void beforePhaseInternal(final PhaseEvent event) {
  FacesContext facesContext = event.getFacesContext();
  ExternalContext externalContext = facesContext.getExternalContext();
  if (event.getPhaseId() != PhaseId.RENDER_RESPONSE) {
    return;
  }
  // Implement POST-REDIRECT-GET pattern
  if (!"POST".equals(getMethod(externalContext))) {
    return;
  }
  if (!ContextUtils.isServlet()) {
    return;
  }
  String nextViewID = facesContext.getViewRoot().getViewId();
  String nextViewURL = facesContext.getApplication().getViewHandler()
  .getActionURL(facesContext, nextViewID);
  if (logger.isDebugEnabled()) {
    logger.debug("Redirecting to " + nextViewURL);
  }
  try {
    event.getFacesContext().getExternalContext().redirect(nextViewURL);
  } catch (Throwable t) {
    logger.error("EXCEPTION: " + t.getMessage());
  }
}

代码示例来源:origin: org.esupportail/ects-utils

/**
 * @param data
 * @param facesContext
 * @param contentType
 * @param fileName
 */
public void setDownLoadAndSend(final byte[] data,
    final FacesContext facesContext,
    final String contentType,
    final String contentDisposition,
    final String fileName) {
  try {
    LOGGER.debug("DownloadUtils.setDownload(data," + fileName + "," + contentType + "," + contentDisposition + ")");
    Long id = DownloadUtils.setDownload(data, fileName, contentType, contentDisposition);
    String url = getDownloadUrl(id);
    ExternalContext externalContext = facesContext.getExternalContext();
    externalContext.redirect(url);
    facesContext.responseComplete();
  } catch (IOException e) {
    LOGGER.error("probleme lors de l envoi d un ficher = " + fileName + "exception : " + e);
  }
}

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

@Override
public void beforePhaseInternal(final PhaseEvent event) {
  FacesContext facesContext = event.getFacesContext();
  ExternalContext externalContext = facesContext.getExternalContext();
  if (event.getPhaseId() != PhaseId.RENDER_RESPONSE) {
    return;
  }
  // Implement POST-REDIRECT-GET pattern
  if (!"POST".equals(getMethod(externalContext))) {
    return;
  }
  if (!ContextUtils.isServlet()) {
    return;
  }
  String nextViewID = facesContext.getViewRoot().getViewId();
  String nextViewURL = facesContext.getApplication().getViewHandler()
  .getActionURL(facesContext, nextViewID);
  if (logger.isDebugEnabled()) {
    logger.debug("Redirecting to " + nextViewURL);
  }
  try {
    event.getFacesContext().getExternalContext().redirect(nextViewURL);
  } catch (Throwable t) {
    logger.error("EXCEPTION: " + t.getMessage());
  }
}

代码示例来源:origin: org.esupportail/ects-domain-services

logger.error("RemoteException in getEtudiant( " + codEtu + " ) = " + e);
  return null;
} catch (WebBaseException e) {
  logger.error("WebBaseException in getEtudiant( " + codEtu + " ) = " + e);
  return null;

相关文章