Examples of ExceptionLog


Examples of br.com.procempa.modus.entity.ExceptionLog

    e = ExceptionLogService.log(e);
    assertTrue(e.getId()!=null);
  }
 
  public void testContextLog(){
    ExceptionLog eLog = null;
    Exception e = new Exception("Minha mensagem de exce��o");
    eLog  = ExceptionLogService.log(e, "Context Message");
    assertTrue(eLog.getId()!=null);
  }
View Full Code Here

Examples of br.com.procempa.modus.entity.ExceptionLog

          }

          // voltar para a lista
          Main.getInstance().buildPanel(EquipamentoSearch.getInstance());
        } catch (PersistException ex1) {
          ExceptionLog eLog = ExceptionLogService
              .log(ex1, "Erro ao salvar Equipamento", UserContext
                  .getInstance().getUsuario().getNome(),
                  UserContext.getInstance().getTelecentro()
                      .getNome());
          ErrorView.show(eLog);
View Full Code Here

Examples of br.com.procempa.modus.entity.ExceptionLog

      Logger.getLogger("Modus").info("Persistencia realizada...");
    } catch (Exception e) {
      String msg = "Falha na persist�ncia do objeto do tipo "
          + p.getClass() + ". ";
      msg += p.getId() != null ? "Id do objeto: " + p.getId() : "";
      ExceptionLog log = ExceptionLogService.log(e, msg);

      // Por enquanto, imprimindo o trace
      // Retirado ap�s o teste do ExceptionLogger
      e.printStackTrace();
View Full Code Here

Examples of br.com.procempa.modus.entity.ExceptionLog

  public static ExceptionLog log(ExceptionLog exception) {
    return logger.log(exception);
  }

  public static ExceptionLog log(Exception e, String contextMessage, String user, String telecentro) {
    ExceptionLog eLog = new ExceptionLog();
           
    eLog.setContextMessage(contextMessage);
    eLog.setException(e.getClass().getName());
    eLog.setMessage(e.getMessage());
    eLog.setUser(UserContext.getInstance().getUsuario());

    StringBuffer buffer = new StringBuffer();
    int length = e.getStackTrace().length;
    for (int i = 0; i < length; i++) {
      buffer.append(e.getStackTrace()[i].getClassName() + STACK_DELIMITER);
      buffer.append(e.getStackTrace()[i].getMethodName() + STACK_DELIMITER);
     
      String tmpFileName = e.getStackTrace()[i].getFileName();
      buffer.append( (tmpFileName == null ? "" : tmpFileName) + STACK_DELIMITER);

      int tmpLineNumber = e.getStackTrace()[i].getLineNumber();
      buffer.append(tmpLineNumber < 1 ? "" : tmpLineNumber);
     
      buffer.append(i < length ? "\n" : "");
    }
   
    eLog.setStackTrace(buffer.toString());

    eLog.setUserName(user);
    eLog.setTelecentro(telecentro);
   
    return log(eLog);
  }
View Full Code Here

Examples of br.com.procempa.modus.entity.ExceptionLog

        .search(
            "FROM ExceptionLog WHERE timestamp >= :dataInicio AND timestamp <= :dataFim",
            params);

    for (Persistent persistent : list) {
      ExceptionLog excecao = (ExceptionLog) persistent;
      RelatorioExcecaoVO excecaoVO = new RelatorioExcecaoVO();
      excecaoVO.setUsuario(excecao.getUserName());
      excecaoVO.setTelecentro(excecao.getTelecentro());
      excecaoVO.setExcecao(excecao.getException());
      excecaoVO.setData(excecao.getTimestamp().getTime());
      excecaoVO.setMensagem(excecao.getMessage());
      excecoes.add(excecaoVO);
    }
    return excecoes;
  }
View Full Code Here

Examples of br.com.procempa.modus.entity.ExceptionLog

          break;
          }   

        } catch (PersistException pe) {
          // TODO Melhorar ContextMessage
          ExceptionLog eLog = ExceptionLogService
              .log(pe, "Erro no salvamento de Usu�rio",
                  UserContext.getInstance().getUsuario()
                      .getNome(), UserContext
                      .getInstance().getTelecentro()
                      .getNome());
View Full Code Here

Examples of br.com.procempa.modus.entity.ExceptionLog

        } catch (BusinessException ex) {
          MessageView.showWarning(ex.getMessage(),
              "Falha ao remover equipamento.");
        } catch (Exception e1) {
          // TODO Implementar controle de exce��es
          ExceptionLog log = ExceptionLogService.log(e1,
              "Falha ao remover equipamento.");
          ErrorView.show(log);
          e1.printStackTrace();
        }
        ((EquipamentoTableModel) table.getModel()).removeItem(eq);
View Full Code Here

Examples of br.com.procempa.modus.entity.ExceptionLog

      } else {
        throw new ValidationException(validationList);
      }
    } catch (NamingException ne) {
      ne.printStackTrace();
      ExceptionLog log = ExceptionLogService.log(ne,
          "Falha na obten��o do PersistentAccess.");
      throw new PersistException(log);
    } catch (SearchException se) {
      se.printStackTrace();
      ExceptionLog log = ExceptionLogService.log(se,
          "Falha na busca de usu�rio");
      throw new PersistException(log);
    } catch (Exception e) {
      if (e instanceof ValidationException) {
        throw (ValidationException) e;
      }
      e.printStackTrace();
      ExceptionLog log = ExceptionLogService.log(e,
          "Falha na persist�ncia de Usu�rio.");
      throw new PersistException(log);
    }

    return usuario;
View Full Code Here

Examples of com.denimgroup.threadfix.data.entities.ExceptionLog

    private final SanitizedLogger log = new SanitizedLogger(QueueErrorHandler.class);

    @Override
    public void handleError(Throwable throwable) {
        ExceptionLog exceptionLog = new ExceptionLog(throwable);

        exceptionLogService.storeExceptionLog(exceptionLog);

        log.error("Uncaught exception - logging with ID " + exceptionLog.getUUID() + ".");
    }
View Full Code Here

Examples of io.undertow.servlet.ExceptionLog

                listeners.requestInitialized(request);
                next.handleRequest(exchange);
                //
            } catch (Throwable t) {

                ExceptionLog log = t.getClass().getAnnotation(ExceptionLog.class);
                if(log != null) {
                    Logger.Level level = log.value();
                    Logger.Level stackTraceLevel = log.stackTraceLevel();
                    String category = log.category();
                    BasicLogger logger = UndertowLogger.REQUEST_LOGGER;
                    if(!category.isEmpty()) {
                        logger = Logger.getLogger(category);
                    }
                    boolean stackTrace = true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.