added ErrorLogger

git-svn-id: https://svn.coded.pt/svn/SIPRP@1233 bb69d46d-e84e-40c8-a05a-06db0d633741
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Diogo Neves 16 years ago
parent 7e839a13c4
commit 25895b5890

@ -5,14 +5,13 @@
package db;
import com.evolute.utils.error.ErrorLogger;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;
import planosactuacao.ApplicationBean1;
import utils.JSFUtils;
/**
*
@ -73,7 +72,7 @@ public class Db {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
return null;
}
}

@ -5,13 +5,11 @@
package db;
import com.evolute.utils.error.ErrorLogger;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.faces.context.FacesContext;
import planosactuacao.ApplicationBean1;
import utils.JSFUtils;
/**
*
@ -68,7 +66,7 @@ public class DbRelatorios {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
return null;
}
}

@ -9,21 +9,20 @@
package db;
import com.evolute.utils.error.ErrorLogger;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;
import planosactuacao.ApplicationBean1;
import utils.JSFUtils;
/**
*
* @author lluis
*/
public class Dblocal {
// String connectionURL = "jdbc:postgresql://storage:5432/siprp_local3"; //testes
// String connectionURL = "jdbc:postgresql://storage:5432/siprp_local_3_20091203"; //testes
//String connectionURL = "jdbc:postgresql://storage/siprp_local_3"; //testes local_3
// String connectionURL = "jdbc:postgresql://www.evolute.pt:5436/siprp_local_3"; //testes local_3
String connectionURL = "jdbc:postgresql://localhost:5436/siprp_local_3";
@ -70,7 +69,7 @@ public class Dblocal {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
return null;
}
}

@ -19,6 +19,7 @@ import org.apache.cayenne.map.DataMap;
import com.evolute.utils.Singleton;
import com.evolute.utils.error.ErrorLogger;
import siprp.SingletonConstants;
/**
@ -71,7 +72,7 @@ public class DblocalRelatorios {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
return null;
}
}

@ -5,6 +5,7 @@
package db.providers;
import com.evolute.utils.error.ErrorLogger;
import db.DbRelatorios;
import db.DblocalRelatorios;
import db.entidades.Area;
@ -17,7 +18,6 @@ import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import utils.Utils;
@ -40,7 +40,7 @@ public class CreatePlanosDataProvider {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
}
@ -111,7 +111,7 @@ public class CreatePlanosDataProvider {
}
catch( Exception e )
{
e.printStackTrace();
ErrorLogger.logException( e );
}
return result;
}
@ -128,7 +128,7 @@ public class CreatePlanosDataProvider {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
return plano;
@ -168,7 +168,7 @@ public class CreatePlanosDataProvider {
catch(Exception ex)
{
System.out.println("ERRO RISCOS BY AREA !!!!");
ex.printStackTrace();
ErrorLogger.logException( ex );
a.setRiscos(null);
}

@ -5,9 +5,7 @@
package db.providers;
import com.evolute.utils.timer.TimedEvent;
import com.evolute.utils.timer.Timer;
import planosactuacao.PlanosActuacao;
import com.evolute.utils.error.ErrorLogger;
import db.Db;
import java.sql.ResultSet;
import java.sql.Statement;
@ -30,7 +28,7 @@ public class GenericDataProvider {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
}
}

@ -5,6 +5,7 @@
package db.providers;
import com.evolute.utils.error.ErrorLogger;
import com.evolute.utils.strings.StringPlainer;
import db.entidades.Area;
import db.entidades.EstadoMedida;
@ -181,6 +182,8 @@ public class PlanosDataProvider extends GenericDataProvider{
sql += "WHERE id = " + p.getId();
System.out.println("SQL UPDATE PLANO : " + sql);
ErrorLogger.log( "SAVE : PlanosDataProvider.updatePlano( p ) : " + sql );
st.execute(sql);
}
@ -242,6 +245,8 @@ public class PlanosDataProvider extends GenericDataProvider{
sql += "verificacao_siprp = '" + r.getVerificacao_siprp() + "' ";
sql += "WHERE id = " + r.getId();
System.out.println("SQL UPDATE RISCO : " + sql);
ErrorLogger.log( "SAVE : PlanosDataProvider.updateRisco( r ) : " + sql );
st.execute(sql);
}
@ -261,6 +266,8 @@ public class PlanosDataProvider extends GenericDataProvider{
String sql = "UPDATE plano_medidas SET estado_medidas_id = " + emID +
" WHERE id = " + m.getId() + " AND risco_id = " + risco.getId();
System.out.println( "SQL UPDATE MEDIDAS : " + sql );
ErrorLogger.log( "SAVE : PlanosDataProvider.updateMedidas( r ) : " + sql );
st.execute( sql );
}
}
@ -318,6 +325,8 @@ public class PlanosDataProvider extends GenericDataProvider{
sql += "verificacao_siprp = '" + v.getVerificacao_siprp() + "' ";
sql += "WHERE id = " + v.getId();
System.out.println("SQL UPDATE VALOR : " + sql);
ErrorLogger.log( "SAVE : PlanosDataProvider.updateValor( v ) : " + sql );
st.execute(sql);
}
@ -951,7 +960,7 @@ public class PlanosDataProvider extends GenericDataProvider{
}
catch(Exception ex)
{
ErrorLogger.logException( ex );
}
return total_riscos;

@ -5,6 +5,7 @@
package db.providers;
import com.evolute.utils.error.ErrorLogger;
import db.Dblocal;
import db.entidades.Area;
import db.entidades.Medida;
@ -38,7 +39,7 @@ public class RelatoriosDataProvider extends GenericDataProvider {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
return plano;
@ -78,7 +79,7 @@ public class RelatoriosDataProvider extends GenericDataProvider {
catch(Exception ex)
{
System.out.println("ERRO RISCOS BY AREA !!!!");
ex.printStackTrace();
ErrorLogger.logException( ex );
a.setRiscos(null);
}

@ -5,6 +5,7 @@
package phaselistener;
import com.evolute.utils.error.ErrorLogger;
import db.entidades.Utilizador;
import db.providers.UtilizadoresDataProvider;
import global.Global;
@ -19,12 +20,33 @@ import planosactuacao.SessionBean1;
import utils.JSFHTTPUtils;
import utils.JSFUtils;
import utils.Logos;
import utils.PlanosActuacaoLogger;
/**
*
* @author lluis
*/
public class MainPhaseListener implements PhaseListener{
private static Boolean loggerIsLoaded = Boolean.FALSE;
static
{
try
{
if ( ! loggerIsLoaded )
{
System.out.println( "\nInitializing logger ..." );
PlanosActuacaoLogger.init();
loggerIsLoaded = Boolean.TRUE;
}
}
catch ( Throwable e )
{
e.printStackTrace( System.err );
}
}
private boolean firstEntry = true;
public void afterPhase(PhaseEvent pe) {
@ -89,13 +111,13 @@ public class MainPhaseListener implements PhaseListener{
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
}
@ -134,12 +156,12 @@ public class MainPhaseListener implements PhaseListener{
}
catch(Exception ex1)
{
ex1.printStackTrace();
ErrorLogger.logException( ex1 );
}
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
/////////////

@ -6,6 +6,7 @@
package planosactuacao;
import com.evolute.utils.error.ErrorLogger;
import com.sun.rave.web.ui.appbase.AbstractApplicationBean;
import java.sql.Connection;
import javax.faces.FacesException;
@ -70,6 +71,7 @@ public class ApplicationBean1 extends AbstractApplicationBean {
try {
_init();
} catch (Exception e) {
ErrorLogger.logException( e );
log("ApplicationBean1 Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}

@ -6,6 +6,7 @@
package planosactuacao;
import com.evolute.utils.error.ErrorLogger;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.Hyperlink;
@ -90,6 +91,7 @@ public class Dummy extends AbstractPageBean {
try {
_init();
} catch (Exception e) {
ErrorLogger.logException( e );
log("Dummy Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
@ -205,7 +207,7 @@ public class Dummy extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
}
@ -224,9 +226,9 @@ public class Dummy extends AbstractPageBean {
getExternalContext().redirect("faces/Erro.jsp");
} catch(Exception e) {
// . . . handle exception . . .
e.printStackTrace();
ErrorLogger.logException( e );
}
ex.printStackTrace();
ErrorLogger.logException( ex );
}
}

@ -6,6 +6,7 @@
package planosactuacao;
import com.evolute.utils.error.ErrorLogger;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.Button;
@ -325,6 +326,7 @@ public class EditarPlano extends AbstractPageBean {
try {
_init();
} catch (Exception e) {
ErrorLogger.logException( e );
log("PlanoActuacao Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
@ -986,7 +988,7 @@ public class EditarPlano extends AbstractPageBean {
}
catch ( Exception e )
{
e.printStackTrace();
ErrorLogger.logException( e );
}
DropDown drop = new DropDown();
@ -1405,7 +1407,7 @@ public class EditarPlano extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
st.setText("Validado por " + nome + " (Director de Loja) a " + p.getData_validacao_dir_loja_str());
gridValidacoes.getChildren().add(st);
@ -1426,7 +1428,7 @@ public class EditarPlano extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
st.setText("Validado por " + nome + " (Director de Loja) a " + p.getData_validacao_dir_loja_str());
gridValidacoes.getChildren().add(st);
@ -1445,7 +1447,7 @@ public class EditarPlano extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
st.setText("Validado por " + nome + " (Director Nacional de Segurança) a " + p.getData_validacao_dns_str());
//st.setText("Validado por Director Nacional de Segurança");
@ -1519,7 +1521,7 @@ public class EditarPlano extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
getSessionBean1().setMsg("Erro na gravação do plano!");
}
@ -1723,7 +1725,7 @@ public class EditarPlano extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
@ -1771,7 +1773,7 @@ public class EditarPlano extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
//Risco r = getNextRisco(getSessionBean1().getPlanoId());
@ -1955,7 +1957,7 @@ public class EditarPlano extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
try
{
@ -1965,7 +1967,7 @@ public class EditarPlano extends AbstractPageBean {
catch(Exception ex)
{
getSessionBean1().setMsg("Erro no envio do Plano");
ex.printStackTrace();
ErrorLogger.logException( ex );
}
}
@ -2356,7 +2358,7 @@ public class EditarPlano extends AbstractPageBean {
}
catch(Exception ex1)
{
ex1.printStackTrace();
ErrorLogger.logException( ex1 );
System.out.println("MAIL ERROR : " + ex1.getMessage());
}
@ -2364,7 +2366,7 @@ public class EditarPlano extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
}
else //fase concluido
@ -2394,7 +2396,7 @@ public class EditarPlano extends AbstractPageBean {
}
catch(Exception ex1)
{
ex1.printStackTrace();
ErrorLogger.logException( ex1 );
System.out.println("MAIL ERROR : " + ex1.getMessage());
}
@ -2402,7 +2404,7 @@ public class EditarPlano extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
}
@ -2410,7 +2412,7 @@ public class EditarPlano extends AbstractPageBean {
// catch(Exception ex)
// {
// //ex.printStackTrace();
// //ErrorLogger.logException( ex );
// }
// Mail mail = new Mail();
// try
@ -2420,7 +2422,7 @@ public class EditarPlano extends AbstractPageBean {
// }
// catch(Exception ex)
// {
// ex.printStackTrace();
// ErrorLogger.logException( ex );
// System.out.println("ERRO NO ENVIO DO EMAIL !!");
// }
// }

@ -6,6 +6,7 @@
package planosactuacao;
import com.evolute.utils.error.ErrorLogger;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.Button;
import com.sun.webui.jsf.component.DropDown;
@ -122,6 +123,7 @@ public class EnviarCorrecao extends AbstractPageBean {
try {
_init();
} catch (Exception e) {
ErrorLogger.logException( e );
log("EnviarCorrecao Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
@ -273,7 +275,7 @@ public class EnviarCorrecao extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
getSessionBean1().setMsg("Erro no envio do plano para a fase " + Global.FASES_TEXTO[fase-1]);
}
return null;
@ -334,7 +336,7 @@ public class EnviarCorrecao extends AbstractPageBean {
}
catch(Exception ex1)
{
ex1.printStackTrace();
ErrorLogger.logException( ex1 );
System.out.println("MAIL ERROR : " + ex1.getMessage());
}
@ -342,7 +344,7 @@ public class EnviarCorrecao extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
//
@ -356,7 +358,7 @@ public class EnviarCorrecao extends AbstractPageBean {
// }
// catch(Exception ex)
// {
// ex.printStackTrace();
// ErrorLogger.logException( ex );
// System.out.println("ERRO NO ENVIO DO EMAIL !!");
// }
}

@ -6,6 +6,7 @@
package planosactuacao;
import com.evolute.utils.error.ErrorLogger;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.StaticText;
import javax.faces.FacesException;
@ -73,6 +74,7 @@ public class Erro extends AbstractPageBean {
try {
_init();
} catch (Exception e) {
ErrorLogger.logException( e );
log("Erro Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}

@ -6,6 +6,7 @@
package planosactuacao;
import com.evolute.utils.error.ErrorLogger;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import javax.faces.FacesException;
@ -63,6 +64,7 @@ public class Footer extends AbstractPageBean {
try {
_init();
} catch (Exception e) {
ErrorLogger.logException( e );
log("Footer Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}

@ -6,6 +6,7 @@
package planosactuacao;
import com.evolute.utils.error.ErrorLogger;
import com.sun.rave.web.ui.appbase.AbstractFragmentBean;
import com.sun.webui.jsf.component.ImageComponent;
import com.sun.webui.jsf.component.StaticText;
@ -84,6 +85,7 @@ public class Header extends AbstractFragmentBean {
try {
_init();
} catch (Exception e) {
ErrorLogger.logException( e );
log("Page1 Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
@ -122,13 +124,13 @@ public class Header extends AbstractFragmentBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
}
catch(Exception ex)
{
ErrorLogger.logException( ex );
}
return null;
}
@ -183,7 +185,7 @@ public class Header extends AbstractFragmentBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
return null;
}
@ -211,7 +213,7 @@ public class Header extends AbstractFragmentBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
return null;
@ -234,7 +236,7 @@ public class Header extends AbstractFragmentBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
return null;

@ -6,13 +6,13 @@
package planosactuacao;
import com.evolute.utils.error.ErrorLogger;
import com.evolute.utils.timer.TimedEvent;
import com.evolute.utils.timer.Timer;
import com.sun.data.provider.RowKey;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.Button;
import com.sun.webui.jsf.component.PanelGroup;
import com.sun.webui.jsf.component.StaticText;
import com.sun.webui.jsf.component.Table;
import com.sun.webui.jsf.component.TableColumn;
import com.sun.webui.jsf.component.TableRowGroup;
@ -363,6 +363,7 @@ public class ListaPlanos extends AbstractPageBean {
try {
_init();
} catch (Exception e) {
ErrorLogger.logException( e );
log("ListaPlanos Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
@ -424,7 +425,7 @@ public class ListaPlanos extends AbstractPageBean {
}
catch(Exception ex2)
{
ex2.printStackTrace();
ErrorLogger.logException( ex2 );
}
}
@ -434,12 +435,12 @@ public class ListaPlanos extends AbstractPageBean {
}
catch(Exception ex1)
{
ex1.printStackTrace();
ErrorLogger.logException( ex1 );
}
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
}
@ -553,7 +554,7 @@ public class ListaPlanos extends AbstractPageBean {
}
catch ( Exception e )
{
e.printStackTrace();
ErrorLogger.logException( e );
}
}
@ -598,7 +599,7 @@ public class ListaPlanos extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
return null;
@ -616,7 +617,7 @@ public class ListaPlanos extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
return null;
@ -634,7 +635,7 @@ public class ListaPlanos extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
@ -673,7 +674,7 @@ FacesContext context = FacesContext.getCurrentInstance();
response.getOutputStream().close();
context.responseComplete();
// } catch (IOException e) {
// e.printStackTrace();
// ErrorLogger.logException( e );
// }
System.out.println("SHOW PDF");
}
@ -688,7 +689,7 @@ FacesContext context = FacesContext.getCurrentInstance();
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
if(!getApplicationBean1().isTimerStarted())
@ -702,6 +703,7 @@ FacesContext context = FacesContext.getCurrentInstance();
}
catch( Exception ex )
{
}
Timer.resetEvent( this );
}
@ -878,7 +880,7 @@ FacesContext context = FacesContext.getCurrentInstance();
}
catch ( Exception e )
{
e.printStackTrace();
ErrorLogger.logException( e );
}
return list;
}
@ -899,7 +901,7 @@ FacesContext context = FacesContext.getCurrentInstance();
// }
// catch(Exception ex)
// {
// ex.printStackTrace();
// ErrorLogger.logException( ex );
// }
// return list;
}
@ -913,7 +915,7 @@ FacesContext context = FacesContext.getCurrentInstance();
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
return list;
}
@ -929,7 +931,7 @@ FacesContext context = FacesContext.getCurrentInstance();
// }
// catch(Exception ex)
// {
// ex.printStackTrace();
// ErrorLogger.logException( ex );
// }
// return list;
}
@ -943,7 +945,7 @@ FacesContext context = FacesContext.getCurrentInstance();
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
return list;
}
@ -959,7 +961,7 @@ FacesContext context = FacesContext.getCurrentInstance();
// }
// catch(Exception ex)
// {
// ex.printStackTrace();
// ErrorLogger.logException( ex );
// }
// return list;
}

@ -6,6 +6,7 @@
package planosactuacao;
import com.evolute.utils.error.ErrorLogger;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.Button;
import com.sun.webui.jsf.component.PasswordField;
@ -95,6 +96,7 @@ public class Login extends AbstractPageBean {
try {
_init();
} catch (Exception e) {
ErrorLogger.logException( e );
log("Login Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
@ -182,9 +184,9 @@ public class Login extends AbstractPageBean {
getExternalContext().redirect("faces/Erro.jsp");
} catch(Exception e) {
// . . . handle exception . . .
e.printStackTrace();
ErrorLogger.logException( e );
}
ex.printStackTrace();
ErrorLogger.logException( ex );
}
}

@ -5,6 +5,7 @@
package planosactuacao;
import com.evolute.utils.error.ErrorLogger;
import db.entidades.Area;
import db.entidades.Medida;
import db.entidades.PlanoActuacao;
@ -13,8 +14,6 @@ import db.entidades.Risco;
import db.entidades.Utilizador;
import db.entidades.Valor;
import db.providers.CreatePlanosDataProvider;
import db.providers.PlanosDataProvider;
import db.providers.RelatoriosDataProvider;
import db.providers.UtilizadoresDataProvider;
import global.Global;
import java.util.ArrayList;
@ -65,7 +64,7 @@ public class PlanosActuacao {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
}
@ -84,7 +83,7 @@ public class PlanosActuacao {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
}
@ -100,7 +99,7 @@ public class PlanosActuacao {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
return list;
}
@ -140,7 +139,7 @@ public class PlanosActuacao {
}
catch(Exception e )
{
e.printStackTrace();
ErrorLogger.logException( e );
}
}
}
@ -170,7 +169,7 @@ public class PlanosActuacao {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
System.out.println("ERRO NA CRIACAO DOS PLANOS : " + ex.getMessage());
}
}
@ -200,7 +199,7 @@ public class PlanosActuacao {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
p.setNome_estabelecimento(relatorio.getToHsMarcacoesEstabelecimento().getToEstabelecimentos().getNome());
p.setData_relatorio(relatorio.getData());
@ -418,7 +417,7 @@ public class PlanosActuacao {
}
catch(Exception ex1)
{
ex1.printStackTrace();
ErrorLogger.logException( ex1 );
System.out.println("MAIL ERROR : " + ex1.getMessage());
}
@ -427,6 +426,7 @@ public class PlanosActuacao {
catch(Exception ex)
{
//ex.printStackTrace();
ErrorLogger.logException( ex );
}
@ -437,7 +437,7 @@ public class PlanosActuacao {
// }
// catch(Exception ex)
// {
// ex.printStackTrace();
// ErrorLogger.logException( ex );
// System.out.println("ERRO NO ENVIO DO EMAIL !!");
// }
}

@ -6,6 +6,7 @@
package planosactuacao;
import com.evolute.utils.error.ErrorLogger;
import com.sun.rave.web.ui.appbase.AbstractRequestBean;
import javax.faces.FacesException;
@ -64,6 +65,7 @@ public class RequestBean1 extends AbstractRequestBean {
try {
_init();
} catch (Exception e) {
ErrorLogger.logException( e );
log("RequestBean1 Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}

@ -6,6 +6,7 @@
package planosactuacao;
import com.evolute.utils.error.ErrorLogger;
import com.sun.rave.web.ui.appbase.AbstractSessionBean;
import db.entidades.Area;
import db.entidades.PlanoActuacao;
@ -115,6 +116,7 @@ public class SessionBean1 extends AbstractSessionBean {
try {
_init();
} catch (Exception e) {
ErrorLogger.logException( e );
log("SessionBean1 Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}

@ -6,9 +6,9 @@
package planosactuacao;
import com.evolute.utils.error.ErrorLogger;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.Button;
import com.sun.webui.jsf.component.Checkbox;
import com.sun.webui.jsf.component.PageSeparator;
import com.sun.webui.jsf.component.PanelGroup;
import com.sun.webui.jsf.component.StaticText;
@ -107,6 +107,7 @@ public class ViewPlano extends AbstractPageBean {
try {
_init();
} catch (Exception e) {
ErrorLogger.logException( e );
log("ViewPlano Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
@ -778,7 +779,7 @@ public class ViewPlano extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
st.setText("Validado por " + nome + " (Director de Loja) a " + p.getData_validacao_dir_loja_str());
grd.getChildren().add(st);
@ -815,7 +816,7 @@ public class ViewPlano extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
st.setText("Validado por " + nome + " (Director Nacional de Segurança) a " + p.getData_validacao_dns_str());
grd.getChildren().add(st);
@ -852,7 +853,7 @@ public class ViewPlano extends AbstractPageBean {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
}
st.setText("Validado por " + nome + " (Técnico de SHS) a " + p.getData_validacao_hs_str());
grd.getChildren().add(st);

@ -5,6 +5,7 @@
package utils;
import com.evolute.utils.error.ErrorLogger;
import db.providers.RelatoriosDataProvider;
import global.Global;
import java.io.File;
@ -46,7 +47,7 @@ public class Logos {
}
catch(Exception ex)
{
ex.printStackTrace();
ErrorLogger.logException( ex );
return null;
}

@ -0,0 +1,39 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package utils;
import com.evolute.utils.error.ErrorLogger;
import com.evolute.utils.error.LoggerProperties;
import com.evolute.utils.error.ProjectsEnum;
import com.evolute.utils.error.log4j.DBLogger;
import java.util.HashMap;
import java.util.Map;
/**
*
* @author dneves
*/
public class PlanosActuacaoLogger
{
private static String EVO_LOGGER_DB = "jdbc:postgresql://www.evolute.pt:5436/evo_logging?logUnclosedConnections=true&loginTimeout=5&socketTimeout=5&tcpKeepAlive=true";
private static String EVO_LOGGER_USER = "evo_logger";
private static String EVO_LOGGER_PASSWD = "Typein1";
public static void init()
{
Map< LoggerProperties, String > map = new HashMap< LoggerProperties, String >();
map.put( LoggerProperties.USERNAME, EVO_LOGGER_USER );
map.put( LoggerProperties.PASSWORD, EVO_LOGGER_PASSWD );
map.put( LoggerProperties.URL, EVO_LOGGER_DB );
map.put( LoggerProperties.PROJECT, ProjectsEnum.PLANOS_ACTUACAO.toString() );
map.put( LoggerProperties.SOFTWARE_VERSION, "1" );
map.put( LoggerProperties.SOFTWARE_NAME, "SIPRP - Planos Actuacao" );
// TODO - firewall - must be implemented over http (ws)
ErrorLogger.initializeLogger( new DBLogger( map ) );
}
}
Loading…
Cancel
Save