Skip to content

Commit

Permalink
Aggiunto ID Sessione al log di dump dei parametri della chiamata alle…
Browse files Browse the repository at this point in the history
… API-Rest.

Aggiunto campo 'causa' nella stampa del log di error per le eccezioni di tipo GovpayException nei controller delle API-Rest.
  • Loading branch information
pintorig committed Nov 9, 2021
1 parent 9d38f9b commit bcb12c8
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ protected void buildContext() {
String servicePathwithParameters = requestUri.substring(idxOfBaseUri);
ctx.getEventoCtx().setUrl(servicePathwithParameters);

String idSessione = null;
if(this.request.getSession() != null) {
idSessione = this.request.getSession().getId();
}

StringBuilder sb = new StringBuilder();
sb.append("Ricevuta una richiesta:");
sb.append("\n");
Expand All @@ -272,6 +277,10 @@ protected void buildContext() {
Utenza utenza = authenticationDetails.getUtenza();
sb.append("Profilo: \n");
sb.append("\t[\n\t").append("TipoUtenza: [").append(authenticationDetails.getTipoUtenza()).append("], Abilitato: [").append(utenza.isAbilitato()).append("]");
if(idSessione != null) {
sb.append("\n");
sb.append("\t").append("Id Sessione: [").append(idSessione).append("]");
}
sb.append("\n");
sb.append("\t").append("Id Transazione Autenticazione: [").append(authenticationDetails.getIdTransazioneAutenticazione()).append("]");
sb.append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ private Response handleUnprocessableEntityException(UriInfo uriInfo, HttpHeaders
}

private Response handleGovpayException(UriInfo uriInfo, HttpHeaders httpHeaders, String methodName, GovPayException e, String transactionId) {
this.log.error("Errore ("+e.getClass().getSimpleName()+") durante "+methodName+": "+ e.getMessage(), e);
this.log.error("Rilevata GovPayException durante l'esecuzione del metodo: "+methodName+", causa: "+ e.getCausa() + ", messaggio: " + e.getMessageV3(), e);
FaultBean respKo = new FaultBean();
int statusCode = e.getStatusCode();
if(e.getFaultBean()!=null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
import it.govpay.core.exceptions.NotAuthenticatedException;
import it.govpay.core.exceptions.NotAuthorizedException;
import it.govpay.core.exceptions.UnprocessableEntityException;
import it.govpay.core.utils.GpContext;
import it.govpay.core.utils.EventoContext.Esito;
import it.govpay.core.utils.GpContext;
import it.govpay.model.Acl.Diritti;
import it.govpay.model.Acl.Servizio;
import it.govpay.model.Utenza.TIPO_UTENZA;
Expand Down Expand Up @@ -210,7 +210,7 @@ private Response handleBaseException(UriInfo uriInfo, HttpHeaders httpHeaders, S
}

private Response handleGovpayException(UriInfo uriInfo, HttpHeaders httpHeaders, String methodName, GovPayException e, String transactionId) {
this.log.error("Errore ("+e.getClass().getSimpleName()+") durante "+methodName+": "+ e.getMessage(), e);
this.log.error("Rilevata GovPayException durante l'esecuzione del metodo: "+methodName+", causa: "+ e.getCausa() + ", messaggio: " + e.getMessageV3(), e);
FaultBean respKo = new FaultBean();
int statusCode = e.getStatusCode();
if(e.getFaultBean()!=null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ private Response handleBaseException(UriInfo uriInfo, HttpHeaders httpHeaders, S
}

private Response handleGovpayException(UriInfo uriInfo, HttpHeaders httpHeaders, String methodName, GovPayException e, String transactionId) {
this.log.error("Errore ("+e.getClass().getSimpleName()+") durante "+methodName+": "+ e.getMessage(), e);
this.log.error("Rilevata GovPayException durante l'esecuzione del metodo: "+methodName+", causa: "+ e.getCausa() + ", messaggio: " + e.getMessageV3(), e);
FaultBean respKo = new FaultBean();
int statusCode = e.getStatusCode();
if(e.getFaultBean()!=null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private Response handleBaseException(UriInfo uriInfo, HttpHeaders httpHeaders, S
}

private Response handleGovpayException(UriInfo uriInfo, HttpHeaders httpHeaders, String methodName, GovPayException e, String transactionId) {
this.log.error("Errore ("+e.getClass().getSimpleName()+") durante "+methodName+": "+ e.getMessage(), e);
this.log.error("Rilevata GovPayException durante l'esecuzione del metodo: "+methodName+", causa: "+ e.getCausa() + ", messaggio: " + e.getMessageV3(), e);
FaultBean respKo = new FaultBean();
int statusCode = e.getStatusCode();
if(e.getFaultBean()!=null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ private Response handleBaseException(UriInfo uriInfo, HttpHeaders httpHeaders, S
}

private Response handleGovpayException(UriInfo uriInfo, HttpHeaders httpHeaders, String methodName, GovPayException e, String transactionId) {
this.log.error("Errore ("+e.getClass().getSimpleName()+") durante "+methodName+": "+ e.getMessage(), e);
this.log.error("Rilevata GovPayException durante l'esecuzione del metodo: "+methodName+", causa: "+ e.getCausa() + ", messaggio: " + e.getMessageV3(), e);
FaultBean respKo = new FaultBean();
int statusCode = e.getStatusCode();
if(e.getFaultBean()!=null) {
Expand Down

0 comments on commit bcb12c8

Please sign in to comment.