diff webapp/WEB-INF/src/HumanEchoServlet.java @ 16:33d7bd3c0990

Adding logging capabilities with log4j to the servlet; adding the log4j 1.2 class as well
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Wed, 04 Dec 2013 19:48:02 +0000
parents 08262829d456
children 00cae11c09bd
line wrap: on
line diff
--- a/webapp/WEB-INF/src/HumanEchoServlet.java	Tue Dec 03 12:19:31 2013 +0000
+++ b/webapp/WEB-INF/src/HumanEchoServlet.java	Wed Dec 04 19:48:02 2013 +0000
@@ -1,7 +1,18 @@
+/*
+ * Classname
+ *
+ * Version information
+ *
+ * 3 December 2013
+ *
+ * Copyright notice
+ */
 
 import java.util.Properties;
 import java.io.IOException;
 
+import org.apache.log4j.*;
+
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -19,6 +30,8 @@
 public class HumanEchoServlet extends HttpServlet {
     private HumanEcho echo;
 
+    private static Logger logger = Logger.getLogger(HumanEchoServlet.class);
+
     public void init(ServletConfig config) throws ServletException {
         super.init(config);
 
@@ -61,6 +74,8 @@
         try {
             echo = new HumanEcho();
 
+            logger.error("We are logging!");
+
             // Matlab structure:
             // Input = struct('dist', 0.9, 'azim', 0, 'orient', 'horz', 'dirweight', 0.2, 'outputfname', 'foo.wav')