git-svn-id: https://svn.coded.pt/svn/SIPRP@1700 bb69d46d-e84e-40c8-a05a-06db0d633741

lxbfYeaa
Diogo Neves 14 years ago
parent b1a48fc639
commit 2b9e0a2231

@ -62,7 +62,7 @@ public class MailerServlet extends HttpServlet
} }
catch( Exception e ) catch( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
} }
@ -84,7 +84,7 @@ public class MailerServlet extends HttpServlet
} }
catch( Exception e ) catch( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
return null; return null;
@ -110,7 +110,7 @@ public class MailerServlet extends HttpServlet
} }
catch( Exception e ) catch( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
return null; return null;
@ -147,7 +147,7 @@ public class MailerServlet extends HttpServlet
} }
catch( Exception e ) catch( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
return false; return false;
@ -200,7 +200,7 @@ public class MailerServlet extends HttpServlet
} }
catch( Exception e ) catch( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
return false; return false;

@ -62,7 +62,7 @@ public class NewsServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception ex ) catch ( Exception ex )
{ {
ErrorLogger.logException( ex ); SiprpWebLogger.logException( ex );
} }
velocityInit = true; velocityInit = true;
} }
@ -78,7 +78,7 @@ public class NewsServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
} }
@ -112,7 +112,7 @@ public class NewsServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception ex ) catch ( Exception ex )
{ {
ErrorLogger.logException( ex ); SiprpWebLogger.logException( ex );
close(); close();
} }
return null; return null;
@ -151,7 +151,7 @@ public class NewsServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
return null; return null;
} }

@ -115,7 +115,7 @@ public class RelatorioServlet extends MailerServlet
} }
catch( Exception e ) catch( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
return null; return null;

@ -136,7 +136,7 @@ public class ScheduleServlet extends MailerServlet
} }
catch( Exception e ) catch( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
return null; return null;

@ -8,7 +8,6 @@ import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener; import javax.servlet.ServletContextListener;
import com.evolute.utils.date.DateUtils; import com.evolute.utils.date.DateUtils;
import com.evolute.utils.error.ErrorLogger;
public class SiprpWebContextListener implements ServletContextListener public class SiprpWebContextListener implements ServletContextListener
@ -21,19 +20,7 @@ public class SiprpWebContextListener implements ServletContextListener
public void contextInitialized( ServletContextEvent event ) public void contextInitialized( ServletContextEvent event )
{ {
startedTime = System.currentTimeMillis(); startedTime = System.currentTimeMillis();
System.out.println( "\n\nsiprpWeb . contextInitialized() : " + startedTime ); System.out.println( "\n\nsiprpWeb . contextInitialized() : " + new Date( startedTime ) );
try
{
System.out.println( "\nInitializing siprpWeb logger ...\n\n" );
SiprpWebLoggerInitializer.init();
}
catch ( Exception e )
{
e.printStackTrace( System.err );
}
ErrorLogger.logException( new Exception( "siprpWeb context initialized." ) );
} }
@Override @Override
@ -47,8 +34,6 @@ public class SiprpWebContextListener implements ServletContextListener
Date endDate = new Date( endTime ); Date endDate = new Date( endTime );
String timePassed = DateUtils.getTimePassed( startedTime, endTime ); String timePassed = DateUtils.getTimePassed( startedTime, endTime );
System.out.println( "\trunning for: " + D_F.format( startDate ) + " -> " + D_F.format( endDate ) + " = " + ( (endTime - startedTime) / 1000 ) + " s ; " + timePassed ); System.out.println( "\trunning for: " + D_F.format( startDate ) + " -> " + D_F.format( endDate ) + " = " + ( (endTime - startedTime) / 1000 ) + " s ; " + timePassed );
ErrorLogger.logException( new Exception( "siprpWeb context destroyed. running for: " + D_F.format( startDate ) + " -> " + D_F.format( endDate ) + " = " + ( (endTime - startedTime) / 1000 ) + " s ; " + timePassed ) );
} }
} }

@ -0,0 +1,17 @@
package com.evolute.siprp.pagina;
public class SiprpWebLogger
{
private SiprpWebLogger()
{
}
public static void logException( Throwable t )
{
System.out.println( "\nSiprpWebLogger . logException() : " );
t.printStackTrace();
}
}

@ -1,36 +0,0 @@
package com.evolute.siprp.pagina;
import java.util.HashMap;
import com.evolute.utils.error.ErrorLogger;
import com.evolute.utils.error.Logger;
import com.evolute.utils.error.LoggerProperties;
import com.evolute.utils.error.ProjectsEnum;
import com.evolute.utils.error.ws.WSLogger;
import com.evolute.utils.network.proxy.EvoProxyObject;
public class SiprpWebLoggerInitializer
{
public static void init() throws Exception
{
HashMap< LoggerProperties, String > properties = new HashMap< LoggerProperties, String >();
properties.put( LoggerProperties.SOFTWARE_NAME, "SIPRP - siprpWeb" );
properties.put( LoggerProperties.SOFTWARE_VERSION, "1" );
properties.put( LoggerProperties.PROJECT, ProjectsEnum.SIPRP.toString() );
properties.put( LoggerProperties.PROJECT_NAME, ProjectsEnum.SIPRP.toString() );
properties.put( LoggerProperties.PROJECT_VERSION, "1" );
String user = "";
String pass = "";
String host = "";
String port = "";
EvoProxyObject.configSystemProxySelector();
EvoProxyObject.getProxy( user, pass, host, port );
Logger logger = new WSLogger( properties );
ErrorLogger.initializeLogger( logger );
}
}

@ -107,17 +107,17 @@ public class doGetListaEmpresas extends siprpServlet
} }
catch ( IllegalStateException e ) // session timeout catch ( IllegalStateException e ) // session timeout
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
out.println( mergeTemplate( msgSessionTimeout, errorTemplate ) ); out.println( mergeTemplate( msgSessionTimeout, errorTemplate ) );
} }
catch ( SQLException e ) catch ( SQLException e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
out.println( mergeTemplate( msgErroBd, errorTemplate ) ); out.println( mergeTemplate( msgErroBd, errorTemplate ) );
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
out.println( mergeTemplate( msgGenericError, userRole, errorTemplate ) ); out.println( mergeTemplate( msgGenericError, userRole, errorTemplate ) );
} }
} }

@ -107,12 +107,12 @@ public class doGetListaEstabelecimentos extends siprpServlet
} }
catch ( SQLException e ) catch ( SQLException e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
out.println( mergeTemplate( msgErroBd, errorTemplate ) ); out.println( mergeTemplate( msgErroBd, errorTemplate ) );
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
out.println( mergeTemplate( msgGenericError, errorTemplate ) ); out.println( mergeTemplate( msgGenericError, errorTemplate ) );
} }
} }

@ -171,7 +171,7 @@ public class doGetListaTrabalhadores extends siprpServlet
// } // }
// catch( Exception ex ) // catch( Exception ex )
// { // {
// ErrorLogger.logException( ex ); // SiprpWebLogger.logException( ex );
// } // }
// trabalhador.put( "proxima_consulta", dataConsulta2 ); // trabalhador.put( "proxima_consulta", dataConsulta2 );
// //
@ -379,12 +379,12 @@ public class doGetListaTrabalhadores extends siprpServlet
} }
catch ( SQLException e ) catch ( SQLException e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
out.println( mergeTemplate( msgErroBd, errorTemplate ) ); out.println( mergeTemplate( msgErroBd, errorTemplate ) );
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
out.println( mergeTemplate( msgGenericError, errorTemplate ) ); out.println( mergeTemplate( msgGenericError, errorTemplate ) );
} }
} }

@ -343,12 +343,12 @@ public class doGetListaTrabalhadoresPendentes
// } // }
// catch ( SQLException e ) // catch ( SQLException e )
// { // {
// ErrorLogger.logException( e ); // SiprpWebLogger.logException( e );
// out.println( mergeTemplate( super.msgErroBd, super.errorTemplate ) ); // out.println( mergeTemplate( super.msgErroBd, super.errorTemplate ) );
// } // }
// catch ( Exception e ) // catch ( Exception e )
// { // {
// ErrorLogger.logException( e ); // SiprpWebLogger.logException( e );
// out.println( mergeTemplate( super.msgGenericError, super.errorTemplate ) ); // out.println( mergeTemplate( super.msgGenericError, super.errorTemplate ) );
// } // }
// } // }

@ -113,12 +113,12 @@ public class doGetListaTrabalhadoresTudo extends siprpServlet implements GlobalC
} }
catch ( SQLException e ) catch ( SQLException e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
out.println( mergeTemplate( msgErroBd, errorTemplate ) ); out.println( mergeTemplate( msgErroBd, errorTemplate ) );
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
out.println( mergeTemplate( msgGenericError, errorTemplate ) ); out.println( mergeTemplate( msgGenericError, errorTemplate ) );
} }
} }
@ -288,12 +288,12 @@ public class doGetListaTrabalhadoresTudo extends siprpServlet implements GlobalC
// } // }
// catch ( SQLException e ) // catch ( SQLException e )
// { // {
// ErrorLogger.logException( e ); // SiprpWebLogger.logException( e );
// out.println( mergeTemplate( super.msgErroBd, super.errorTemplate ) ); // out.println( mergeTemplate( super.msgErroBd, super.errorTemplate ) );
// } // }
// catch ( Exception e ) // catch ( Exception e )
// { // {
// ErrorLogger.logException( e ); // SiprpWebLogger.logException( e );
// out.println( mergeTemplate( super.msgGenericError, super.errorTemplate ) ); // out.println( mergeTemplate( super.msgGenericError, super.errorTemplate ) );
// } // }
// } // }

@ -210,12 +210,12 @@ public class doGetTrabalhador extends siprpServlet
} }
catch ( SQLException e ) catch ( SQLException e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
out.println( mergeTemplate( msgErroBd, errorTemplate ) ); out.println( mergeTemplate( msgErroBd, errorTemplate ) );
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
out.println( mergeTemplate( msgGenericError, errorTemplate ) ); out.println( mergeTemplate( msgGenericError, errorTemplate ) );
} }

@ -104,38 +104,38 @@ public class doPostLogin extends siprpServlet
} }
catch ( SQLException e ) catch ( SQLException e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
try try
{ {
doErro( "erro=" + msgErroBd, out ); doErro( "erro=" + msgErroBd, out );
} }
catch ( Exception ex ) catch ( Exception ex )
{ {
ErrorLogger.logException( ex ); SiprpWebLogger.logException( ex );
} }
} }
catch ( IllegalStateException e ) // session timeout catch ( IllegalStateException e ) // session timeout
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
try try
{ {
doErro( "erro=" + msgSessionTimeout, out ); doErro( "erro=" + msgSessionTimeout, out );
} }
catch ( Exception ex ) catch ( Exception ex )
{ {
ErrorLogger.logException( ex ); SiprpWebLogger.logException( ex );
} }
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
try try
{ {
doErro( "erro=" + msgGenericError, out ); doErro( "erro=" + msgGenericError, out );
} }
catch ( Exception ex ) catch ( Exception ex )
{ {
ErrorLogger.logException( ex ); SiprpWebLogger.logException( ex );
} }
} }
} }

@ -135,7 +135,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
} }
@ -257,17 +257,17 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( NumberFormatException e ) // argumentos invalidos catch ( NumberFormatException e ) // argumentos invalidos
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
out.println( mergeTemplate( msgLinkFormatError, backUri, errorTemplate ) ); out.println( mergeTemplate( msgLinkFormatError, backUri, errorTemplate ) );
} }
catch ( IllegalStateException e ) // session timeout catch ( IllegalStateException e ) // session timeout
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
out.println( mergeTemplate( msgSessionTimeout, errorTemplate ) ); out.println( mergeTemplate( msgSessionTimeout, errorTemplate ) );
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
// out.println( mergeTemplate( msgGenericError , backUri, // out.println( mergeTemplate( msgGenericError , backUri,
// errorTemplate ) ); // errorTemplate ) );
out.println( mergeTemplate( msgGenericError, errorTemplate ) ); out.println( mergeTemplate( msgGenericError, errorTemplate ) );
@ -297,17 +297,17 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
} }
/* /*
* catch ( SQLException e ) { ErrorLogger.logException( e ); out.println( * catch ( SQLException e ) { SiprpWebLogger.logException( e ); out.println(
* mergeTemplate( msgErroBd , criticalErrorTemplate) ); } * mergeTemplate( msgErroBd , criticalErrorTemplate) ); }
*/ */
catch ( IllegalStateException e ) // session timeout catch ( IllegalStateException e ) // session timeout
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
out.println( mergeTemplate( msgSessionTimeout, errorTemplate ) ); out.println( mergeTemplate( msgSessionTimeout, errorTemplate ) );
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
out.println( mergeTemplate( msgGenericError, errorTemplate ) ); out.println( mergeTemplate( msgGenericError, errorTemplate ) );
} }
} }
@ -330,7 +330,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
return null; return null;
} }
@ -348,7 +348,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
return null; return null;
} }
@ -368,7 +368,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
return null; return null;
} }
@ -391,7 +391,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
return null; return null;
} }
@ -409,7 +409,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
} }
@ -451,7 +451,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
return false; return false;
} }
@ -485,7 +485,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
return false; return false;
} }
@ -499,7 +499,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
} }
@ -530,7 +530,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
return null; return null;
} }
@ -569,7 +569,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
return null; return null;
} }
@ -609,7 +609,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
return null; return null;
} }
@ -640,7 +640,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
ErrorLogger.logException( e ); SiprpWebLogger.logException( e );
} }
return null; return null;
} }

Loading…
Cancel
Save