From 2b70ab18a97dd248d478d985ae602bd7e3a9d320 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Fri, 28 Nov 2014 11:04:46 +0100 Subject: Logging Error Levels adapted --- .../main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java | 2 +- .../src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java | 6 +++--- .../main/java/at/gv/egiz/pdfas/web/helper/RemotePDFFetcher.java | 4 ++-- .../main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java | 4 ++-- .../java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java | 2 +- .../src/main/java/at/gv/egiz/pdfas/web/servlets/PDFData.java | 6 +++--- .../gv/egiz/pdfas/web/servlets/PDFSignatureCertificateData.java | 8 ++++---- .../main/java/at/gv/egiz/pdfas/web/servlets/PDFSignatureData.java | 6 +++--- .../java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java | 2 +- .../main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java | 6 +++--- .../main/java/at/gv/egiz/pdfas/web/servlets/VisBlockServlet.java | 4 ++-- .../src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java | 4 ++-- .../main/java/at/gv/egiz/pdfas/web/ws/PDFASVerificationImpl.java | 2 +- 13 files changed, 28 insertions(+), 28 deletions(-) (limited to 'pdf-as-web/src/main') diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java index 0fbd9163..c16eec27 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java @@ -323,7 +323,7 @@ public class WebConfiguration implements IConfigurationConstants { return true; } } catch (Throwable e) { - logger.error("Error in matching regex: " + pattern, e); + logger.warn("Error in matching regex: " + pattern, e); } } diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java index 53085ca2..7f900b0f 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java @@ -293,7 +293,7 @@ public class PdfAsHelper { try { signIdx = Integer.parseInt(signidxString); } catch (Throwable e) { - logger.error("Failed to parse Signature Index: " + logger.warn("Failed to parse Signature Index: " + signidxString); } } @@ -1097,12 +1097,12 @@ public class PdfAsHelper { if (obj != null) { try { if (!(obj instanceof List)) { - logger.error("Invalid object type"); + logger.warn("Invalid object type"); return null; } return (List) obj; } catch (Throwable e) { - logger.error("Invalid object type"); + logger.warn("Invalid object type"); } } return null; diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/RemotePDFFetcher.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/RemotePDFFetcher.java index f3c1c946..462c1bc8 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/RemotePDFFetcher.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/RemotePDFFetcher.java @@ -44,7 +44,7 @@ public class RemotePDFFetcher { try { url = new URL(pdfURL); } catch (MalformedURLException e) { - logger.error("Not a valid URL!", e); + logger.warn("Not a valid URL!", e); throw new PdfAsWebException("Not a valid URL!", e); } if (WebConfiguration.isProvidePdfURLinWhitelist(url.toExternalForm())) { @@ -55,7 +55,7 @@ public class RemotePDFFetcher { InputStream is = url.openStream(); return StreamUtils.inputStreamToByteArray(is); } catch (Exception e) { - logger.error("Failed to fetch pdf document!", e); + logger.warn("Failed to fetch pdf document!", e); throw new PdfAsWebException( "Failed to fetch pdf document!", e); } diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java index 5b951b78..86bef9f3 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java @@ -94,7 +94,7 @@ public class DataURLServlet extends HttpServlet { PdfAsHelper.injectSignature(request, response, createCMSSignatureResponseType, getServletContext()); } else if(jaxbObject.getValue() instanceof ErrorResponseType) { ErrorResponseType errorResponseType = (ErrorResponseType)jaxbObject.getValue(); - logger.error("SecurityLayer: " + errorResponseType.getErrorCode() + " " + errorResponseType.getInfo()); + logger.warn("SecurityLayer: " + errorResponseType.getErrorCode() + " " + errorResponseType.getInfo()); throw new PdfAsSecurityLayerException(errorResponseType.getInfo(), errorResponseType.getErrorCode()); } else { @@ -102,7 +102,7 @@ public class DataURLServlet extends HttpServlet { 9999); } } catch (Exception e) { - logger.error("Error in DataURL Servlet. " , e); + logger.warn("Error in DataURL Servlet. " , e); PdfAsHelper.setSessionException(request, response, e.getMessage(), e); PdfAsHelper.gotoError(getServletContext(), request, response); diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java index 7900dfde..0982c98c 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java @@ -194,7 +194,7 @@ public class ExternSignServlet extends HttpServlet { } } catch(Throwable e) { - logger.error("In resolving filename", e); + logger.warn("In resolving filename", e); } if(filecontent.length < 10) { filecontent = null; diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFData.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFData.java index b0c434af..483b9707 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFData.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFData.java @@ -85,9 +85,9 @@ public class PDFData extends HttpServlet { if(plainPDFDigest != null) { String signatureDataHash = PdfAsHelper.getSignatureDataHash(request); if(!plainPDFDigest.equalsIgnoreCase(signatureDataHash)) { - logger.error("Digest Hash mismatch!"); - logger.error("Requested digest: " + plainPDFDigest); - logger.error("Saved digest: " + signatureDataHash); + logger.warn("Digest Hash mismatch!"); + logger.warn("Requested digest: " + plainPDFDigest); + logger.warn("Saved digest: " + signatureDataHash); PdfAsHelper.setSessionException(request, response, "Signature Data digest do not match!", null); diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFSignatureCertificateData.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFSignatureCertificateData.java index 9b3e9f31..e4465e77 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFSignatureCertificateData.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFSignatureCertificateData.java @@ -99,17 +99,17 @@ public class PDFSignatureCertificateData extends HttpServlet { os.write(res.getSignerCertificate().getEncoded()); os.close(); } else { - logger.error("Verification CERT not found! for id " + request.getParameter(SIGN_ID) + " in session " + request.getSession().getId()); + logger.warn("Verification CERT not found! for id " + request.getParameter(SIGN_ID) + " in session " + request.getSession().getId()); response.sendError(HttpServletResponse.SC_NOT_FOUND); } } catch (NumberFormatException e) { - logger.error("Verification CERT not found! for id " + request.getParameter(SIGN_ID) + " in session " + request.getSession().getId()); + logger.warn("Verification CERT not found! for id " + request.getParameter(SIGN_ID) + " in session " + request.getSession().getId()); response.sendError(HttpServletResponse.SC_NOT_FOUND); } catch (PdfAsException e) { - logger.error("Verification CERT not found:", e); + logger.warn("Verification CERT not found:", e); response.sendError(HttpServletResponse.SC_NOT_FOUND); } catch (CertificateEncodingException e) { - logger.error("Verification CERT invalid:", e); + logger.warn("Verification CERT invalid:", e); response.sendError(HttpServletResponse.SC_NOT_FOUND); } } diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFSignatureData.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFSignatureData.java index 63a38c52..e493f4ae 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFSignatureData.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFSignatureData.java @@ -98,14 +98,14 @@ public class PDFSignatureData extends HttpServlet { os.write(res.getSignatureData()); os.close(); } else { - logger.error("Verification DATA not found! for id " + request.getParameter(SIGN_ID) + " in session " + request.getSession().getId()); + logger.warn("Verification DATA not found! for id " + request.getParameter(SIGN_ID) + " in session " + request.getSession().getId()); response.sendError(HttpServletResponse.SC_NOT_FOUND); } } catch (NumberFormatException e) { - logger.error("Verification DATA not found! for id " + request.getParameter(SIGN_ID) + " in session " + request.getSession().getId()); + logger.warn("Verification DATA not found! for id " + request.getParameter(SIGN_ID) + " in session " + request.getSession().getId()); response.sendError(HttpServletResponse.SC_NOT_FOUND); } catch (PdfAsException e) { - logger.error("Verification DATA not found:", e); + logger.warn("Verification DATA not found:", e); response.sendError(HttpServletResponse.SC_NOT_FOUND); } } diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java index e602a8e0..53be36da 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java @@ -166,7 +166,7 @@ public class UIEntryPointServlet extends HttpServlet { } } catch (Throwable e) { - logger.error("Failed to process Request: ", e); + logger.warn("Failed to process Request: ", e); PdfAsHelper.setSessionException(req, resp, e.getMessage(), e); PdfAsHelper.gotoError(getServletContext(), req, resp); } diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java index aaa6afbb..32bb41ac 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java @@ -99,7 +99,7 @@ public class VerifyServlet extends HttpServlet { byte[] pdfData = RemotePDFFetcher.fetchPdfFile(pdfUrl); doVerify(request, response, pdfData); } catch (Throwable e) { - logger.error("Generic Error: ", e); + logger.warn("Generic Error: ", e); PdfAsHelper.setSessionException(request, response, e.getMessage(), e); PdfAsHelper.gotoError(getServletContext(), request, response); @@ -187,7 +187,7 @@ public class VerifyServlet extends HttpServlet { name); } } catch (Throwable e) { - logger.error("In resolving filename", e); + logger.warn("In resolving filename", e); } if (filecontent.length < 10) { filecontent = null; @@ -233,7 +233,7 @@ public class VerifyServlet extends HttpServlet { doVerify(request, response, filecontent); } catch (Throwable e) { - logger.error("Generic Error: ", e); + logger.warn("Generic Error: ", e); PdfAsHelper.setSessionException(request, response, e.getMessage(), e); PdfAsHelper.gotoError(getServletContext(), request, response); diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VisBlockServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VisBlockServlet.java index 1ee6f0f8..b49264f7 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VisBlockServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VisBlockServlet.java @@ -83,10 +83,10 @@ public class VisBlockServlet extends HttpServlet { throw new ServletException(PARAM_RESOLUTION + " invalid value! Not a Number"); } catch (CertificateException e) { - logger.error("CERT Error", e); + logger.warn("CERT Error", e); throw new ServletException("Failed to find certificate"); } catch (PDFASError e) { - logger.error("PDF_AS Error", e); + logger.warn("PDF_AS Error", e); throw new ServletException("Generic Error"); } } diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java index d15492b4..91aec279 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java @@ -149,7 +149,7 @@ public class PDFASSigningImpl implements PDFASSigning { response.setRedirectUrl(userEntryURL); } } catch (Throwable e) { - logger.error("Error in Soap Service", e); + logger.warn("Error in Soap Service", e); if (e.getCause() != null) { response.setError(e.getCause().getMessage()); } else { @@ -179,7 +179,7 @@ public class PDFASSigningImpl implements PDFASSigning { logger.debug("Done SOAP Sign Request"); return response; } - logger.error("Server Signature failed. [PDFASBulkSignRequest is NULL]"); + logger.warn("Server Signature failed. [PDFASBulkSignRequest is NULL]"); if (WebConfiguration.isShowErrorDetails()) { throw new WebServiceException("PDFASBulkSignRequest is NULL"); diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASVerificationImpl.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASVerificationImpl.java index 0257f835..e46da89e 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASVerificationImpl.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASVerificationImpl.java @@ -112,7 +112,7 @@ public class PDFASVerificationImpl implements PDFASVerification { response.getVerifyResults().add(webResult); } } catch (Exception e) { - logger.error("Failed to verify PDF", e); + logger.warn("Failed to verify PDF", e); if (WebConfiguration.isShowErrorDetails()) { throw new WebServiceException("Generic Error", e); } else { -- cgit v1.2.3