Index: /trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlClientInfos.java
===================================================================
--- /trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlClientInfos.java	(revision 1226)
+++ /trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlClientInfos.java	(revision 1227)
@@ -92,3 +92,19 @@
     }
 
+    /**
+     * @return the id of the monitored web application which is the host and port
+     */
+    String getWebAppId() {
+        String id = url.getHost();
+        if ("".equals(id)) {
+            id = "unknown";
+        }
+        
+        if (url.getPort() > 0) {
+            id += "_" + url.getPort();
+        }
+        
+        return id;
+    }
+
 }
Index: /trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorLogManager.java
===================================================================
--- /trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorLogManager.java	(revision 1226)
+++ /trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorLogManager.java	(revision 1227)
@@ -41,5 +41,5 @@
      * the timeout after which a writer of an inactive client is closed
      */
-    private static final int SESSION_TIMEOUT = 100000;
+    private static final int SESSION_TIMEOUT = 10 * 60 * 1000;
     
     /**
@@ -126,6 +126,7 @@
                     writer = writers.get(clientInfos.getClientId());
                     if (writer == null) {
-                        writer =
-                            new HtmlMonitorOutputWriter(logFileBaseDir, clientInfos.getClientId());
+                        writer = new HtmlMonitorOutputWriter
+                            (logFileBaseDir, clientInfos.getWebAppId(), clientInfos.getClientId());
+
                         writer.init();
                         writer.start();
Index: /trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorOutputWriter.java
===================================================================
--- /trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorOutputWriter.java	(revision 1226)
+++ /trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorOutputWriter.java	(revision 1227)
@@ -51,5 +51,5 @@
      * the maximum size of an individual log file
      */
-    private static final int MAXIMUM_LOG_FILE_SIZE = 10000000;
+    private static final int MAXIMUM_LOG_FILE_SIZE = 50000000;
 
     /**
@@ -62,4 +62,9 @@
      */
     private File logFileBaseDir;
+
+    /**
+     * the id of the web application used by the client
+     */
+    private String webAppId;
 
     /**
@@ -97,7 +102,8 @@
      * @param logFileBaseDir the log file base directory, or null if the default directory shall
      *                       be taken
+     * @param webAppId       the ID of the web application used by the client
      * @param clientId       the ID of the client, for which this writer logs
      */
-    public HtmlMonitorOutputWriter(String logFileBaseDir, String clientId) {
+    public HtmlMonitorOutputWriter(String logFileBaseDir, String webAppId, String clientId) {
         if (logFileBaseDir == null) {
             this.logFileBaseDir = new File(DEFAULT_LOG_FILE_BASE_DIR);
@@ -107,4 +113,5 @@
         }
         
+        this.webAppId = webAppId;
         this.clientId = clientId;
         
@@ -123,6 +130,7 @@
         synchronized (HtmlMonitorOutputWriter.class) {
             try {
-                File clientLogDir = new File(logFileBaseDir, clientId);
-            
+                File clientLogDir = new File(logFileBaseDir, webAppId);
+                clientLogDir = new File(clientLogDir, clientId);
+                
                 if (!clientLogDir.exists()) {
                     if (!clientLogDir.mkdirs()) {
@@ -136,4 +144,6 @@
                 }
                 
+                handleOldLogFiles(new File(logFileBaseDir, clientId), clientLogDir);
+                
                 logFile = new File(clientLogDir, getLogFileName(-1));
                 
@@ -318,5 +328,5 @@
         }
         else {
-            val = value.toString();
+            val = String.valueOf(value);
         }
         
@@ -399,4 +409,23 @@
     }
 
+    /**
+     * <p>
+     * this method moves old logfiles of the same client resisting in the wrong old directory
+     * structure to the new one.
+     * </p>
+     *
+     * @param file
+     * @param clientLogDir
+     */
+    private void handleOldLogFiles(File oldLogDir, File newLogDir) {
+        if (oldLogDir.exists() && oldLogDir.isDirectory()) {
+            for (File oldLogFile : oldLogDir.listFiles()) {
+                oldLogFile.renameTo(new File(newLogDir, oldLogFile.getName()));
+            }
+            
+            oldLogDir.delete();
+        }
+    }
+
     /* (non-Javadoc)
      * @see de.ugoe.cs.autoquest.htmlmonitor.HtmlMonitorComponent#stop()
