Index: other-projects/the-macronizer/trunk/build.xml
===================================================================
--- other-projects/the-macronizer/trunk/build.xml	(revision 31961)
+++ other-projects/the-macronizer/trunk/build.xml	(revision 31962)
@@ -9,4 +9,5 @@
   <property name="build.dir.exp"   location="web" />
   <property name="lib.dir.exp"  location="web/WEB-INF/lib" />
+  <property name="webinf.dir"  location="web/WEB-INF" />
   
   <!--
@@ -40,5 +41,5 @@
   </target>
 	
-  <target depends="init" name="build">
+  <target name="build" depends="init">
     <javac source="${javac.source}" target="${javac.target}" debug="${javac.debug}"
 	   encoding="utf-8"
@@ -49,11 +50,22 @@
 	<path refid="classpath.exp"/>
 	<pathelement location="src/jars/servlet-api.jar"/>
-	<pathelement path="src/java"/>			  
+	<pathelement path="src/java"/>
+	<pathelement path="webinf.dir"/>
       </classpath>
     </javac>
+
+    <!-- http://ant.apache.org/manual/Tasks/copy.html
+	 By default, files are only copied if the source file is newer than the destination file,
+	 or when the destination file does not exist. However, you can explicitly overwrite files
+	 with the overwrite attribute.-->
+    <copy file="${build.dir.exp}/log4j.properties.in" tofile="/greenstone/greenstone3/web/WEB-INF/classes/log4j.properties"/>
+
+    <!-- mkdir Creates a directory. Also non-existent parent directories are created,
+	 when necessary. Does nothing if the directory already exist. -->
+    <mkdir dir="${build.dir.exp}/logs"/>
   </target>
 
 	
-  <target depends="build" name="war">
+  <target name="war" depends="build">
     <jar destfile="${dist.filename.exp}">  
       <fileset dir="${build.dir.exp}" />
Index: other-projects/the-macronizer/trunk/src/java/web/servlets/DirectInput.java
===================================================================
--- other-projects/the-macronizer/trunk/src/java/web/servlets/DirectInput.java	(revision 31961)
+++ other-projects/the-macronizer/trunk/src/java/web/servlets/DirectInput.java	(revision 31962)
@@ -23,4 +23,5 @@
 import monogram.plugin.PluginConfiguration;
 import monogram.plugin.PluginManager;
+import org.apache.log4j.*;
 
 /**
@@ -32,6 +33,8 @@
     private final String UNEXPECTED_ERROR = "An unexpected error has occurred. Please try again or contact the web administrator if the problem persists.";
     private final String UTF8_ENCODING = "utf-8";
-    public static boolean DI; // This will be used in a test in the mongramRestorer to add html to highligth the changes on the webpage output. 
+    public static boolean DI; // This will be used in a test in the mongramRestorer to add html to highlight the changes on the webpage output. 
     private File tmpdir;
+    //Create an instance of the Logger object created for this class in log4j.properties
+    static Logger logger = Logger.getLogger(web.servlets.DirectInput.class.getName());
 
     @Override
@@ -86,5 +89,5 @@
         File file = File.createTempFile("mi-tmp-", ".txt", tmpdir);
         write(file, "utf-8", fragment);
-
+       	
         //Create a fileview
         PluginConfiguration configuration = new PluginConfiguration();
@@ -107,12 +110,14 @@
             RequestDispatcher dispatcher = this.getServletContext().getRequestDispatcher(path + "/main.jsp");
             dispatcher.forward(request, response);
+	    //Generate an "info" level logger message including the input('fragment') and output('restoredFragment')
+	    logger.info("Input:"+fragment+"Output: "+restoredFragment);
         } catch (Exception e) {
            request.setAttribute("errorMessage", UNEXPECTED_ERROR);
            forward(path + "/error.jsp", request, response);
         } finally {
-            file.delete();
-	    if (restoredFile != null) {
-		restoredFile.delete();
-	    }
+	 file.delete();
+	  if (restoredFile != null) {
+	 	restoredFile.delete();
+	  }
         }
     }
Index: other-projects/the-macronizer/trunk/src/java/web/servlets/FileUpload.java
===================================================================
--- other-projects/the-macronizer/trunk/src/java/web/servlets/FileUpload.java	(revision 31961)
+++ other-projects/the-macronizer/trunk/src/java/web/servlets/FileUpload.java	(revision 31962)
@@ -1,6 +1,9 @@
 package web.servlets;
 
+import java.io.BufferedReader;
 import java.io.File;
+import java.io.FileReader;
 import java.io.IOException;
+import java.lang.StringBuilder;
 import java.util.List;
 import javax.servlet.RequestDispatcher;
@@ -16,4 +19,5 @@
 import util.FileUtil;
 import monogram.plugin.PluginManager;
+import org.apache.log4j.*;
 
 /**
@@ -25,4 +29,7 @@
 
     private File tmpdir;
+
+    //Create an instance of the Logger object created for this class in log4j.properties            
+    static Logger logger = Logger.getLogger(web.servlets.DirectInput.class.getName());
 
     @Override
@@ -77,4 +84,6 @@
             request.setAttribute("options", properties.getOptions());
             forward(address + "/main.jsp", request, response);
+	    String outputText = stringFromFile(restoredFile);
+	    logger.error("Output:"+outputText);
         } catch (UnsupportedOperationException e) {
             FileUtil.deleteFile(restoredFile);
@@ -126,4 +135,6 @@
                     requestData.setFile(file);
                     requestData.setFilename(item.getName());
+		    String logText=stringFromFile(file);
+		    logger.error("Input:"+logText);
                 }
             }
@@ -133,5 +144,23 @@
         return requestData;
     }
-
+    
+    private String stringFromFile(File file)throws IOException{
+	BufferedReader reader = new BufferedReader(new FileReader(file));
+	String line = null;
+	StringBuilder sb = new StringBuilder();
+	try{
+	    while((line=reader.readLine())!=null){
+		sb.append(line);
+	    }
+	    return sb.toString();
+	}
+	catch (Exception e){
+	    e.printStackTrace();
+	}
+	finally{
+	    reader.close();
+	}
+    }
+    
     private PluginConfiguration configure(Properties properties) {
         final File file = properties.getFile();
Index: other-projects/the-macronizer/trunk/web/index.jsp
===================================================================
--- other-projects/the-macronizer/trunk/web/index.jsp	(revision 31961)
+++ other-projects/the-macronizer/trunk/web/index.jsp	(revision 31962)
@@ -5,13 +5,3 @@
 --%>
 
-<%@page contentType="text/html" pageEncoding="UTF-8"%>
-<!DOCTYPE html>
-<html>
-    <head>
-        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-        <title>JSP test Page</title>
-    </head>
-    <body>
-        <h1>Hello World!</h1>
-    </body>
-</html>
+<% response.sendRedirect("jsp/mi/main.jsp"); %>
Index: other-projects/the-macronizer/trunk/web/jsp/en/footer.jsp
===================================================================
--- other-projects/the-macronizer/trunk/web/jsp/en/footer.jsp	(revision 31961)
+++ other-projects/the-macronizer/trunk/web/jsp/en/footer.jsp	(revision 31962)
@@ -21,4 +21,5 @@
 </div>
 <div id="copyright">
+    <p>This website collects simple usage logs which will be used for development purposes only. No details which could be used to identify individuals will be collected and the data will be kept securely at the University of Waikato. If you do not wish for your activity to be included, click <a href="mailto:tetaka@waikato.ac.nz">here</a> to notify Dr. Te Taka Keegan. </p>
     <p class="note">Copyright &copy; 2014 University of Waikato</p>
 </div>
Index: other-projects/the-macronizer/trunk/web/jsp/mi/footer.jsp
===================================================================
--- other-projects/the-macronizer/trunk/web/jsp/mi/footer.jsp	(revision 31961)
+++ other-projects/the-macronizer/trunk/web/jsp/mi/footer.jsp	(revision 31962)
@@ -21,4 +21,5 @@
 </div>
 <div id="copyright">
+    <p>This website collects simple usage logs which will be used for development purposes only. No details which could be used to identify individuals will be collected and the data will be kept securely at the University of Waikato. If you do not wish for your activity to be included, click <a href="mailto:tetaka@waikato.ac.nz">here</a> to notify Dr. Te Taka Keegan.</p> 
     <p class="note">ManatÄrua &copy; 2011 nÄ John Cocks</p>
 </div>
Index: other-projects/the-macronizer/trunk/web/log4j.properties.in
===================================================================
--- other-projects/the-macronizer/trunk/web/log4j.properties.in	(revision 31962)
+++ other-projects/the-macronizer/trunk/web/log4j.properties.in	(revision 31962)
@@ -0,0 +1,28 @@
+# See for basic example https://stackoverflow.com/questions/125 32339/no-appenders-could-be-found-for-loggerlog4j
+# For better examples, see /greenstone/greenstone3/web/WEB-INF/classes/log4j.properties
+
+####################### 
+
+# define some reusable properties
+macronizer.home=/greenstone/macron-restoration
+macronizer.logplace=${macronizer.home}/web/logs
+
+# Let's log everything from the most basic DEBUG msgs on (so INFO, WARN, ERROR too)
+log4j.rootCategory=DEBUG, macronlog
+
+# copied from GS3
+log4j.category.web.servlets.DirectInput=INFO, macronlog
+log4j.additivity.web.servlets.DirectInput=false
+
+# We're saying our log "macronlog" is some file that gets appended to,
+# and it will write it out to "macron.log" located in whatever we defined the "logplace" to be
+log4j.appender.macronlog=org.apache.log4j.RollingFileAppender
+log4j.appender.macronlog.File=${macronizer.logplace}/macron.log
+
+# if you have more logs, define rootcategory, appender and appender.File for it as above
+# for each log also set the format of the output as below, after setting the layout to use PatternLayout class to parse the format
+
+log4j.appender.macronlog.layout=org.apache.log4j.PatternLayout
+log4j.appender.macronlog.layout.ConversionPattern=%-5p: [%d{yyyy-MM-dd hh:mm:ss}] %C{1}.%M()%n %m%n
+
+#######################
