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/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 ++-- 8 files changed, 19 insertions(+), 19 deletions(-) (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets') 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"); } } -- cgit v1.2.3