From 2b99f94865958d349fd67fc0adf8e173203421bf Mon Sep 17 00:00:00 2001 From: Sean Flanigan Date: Wed, 19 Mar 2014 12:14:15 +1000 Subject: [PATCH] Reduce logging for GWT file uploads --- .../java/org/zanata/servlet/FileUploadServlet.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/zanata-war/src/main/java/org/zanata/servlet/FileUploadServlet.java b/zanata-war/src/main/java/org/zanata/servlet/FileUploadServlet.java index fbcf282ef0..bea7505dd3 100644 --- a/zanata-war/src/main/java/org/zanata/servlet/FileUploadServlet.java +++ b/zanata-war/src/main/java/org/zanata/servlet/FileUploadServlet.java @@ -31,6 +31,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import lombok.extern.slf4j.Slf4j; + import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory; @@ -60,6 +62,7 @@ * @author Alex Eng aeng@redhat.com * */ +@Slf4j public class FileUploadServlet extends HttpServlet { private static final long serialVersionUID = 1L; @@ -71,9 +74,6 @@ public class FileUploadServlet extends HttpServlet { private TranslationService translationServiceImpl; - private static final Logger LOGGER = LoggerFactory - .getLogger(FileUploadServlet.class); - @Override protected void doPost(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, @@ -120,8 +120,10 @@ private void doWork(HttpServletRequest req, HttpServletResponse resp) HashMap params = new HashMap(); for (FileItem item : items) { - LOGGER.info("param- " + item.getFieldName() + " value-" - + item.getString()); + if (log.isDebugEnabled()) { + log.debug("param- " + item.getFieldName() + " value-" + + item.getString()); + } params.put(item.getFieldName(), item); }