You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2015/04/13 05:22:26 UTC

[13/16] stratos git commit: Formatting Logging view module

Formatting Logging view module


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/f3355d97
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/f3355d97
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/f3355d97

Branch: refs/heads/master
Commit: f3355d970eb21822259ddaad42393c18488b3bc7
Parents: 76b39e1
Author: Lahiru Sandaruwan <la...@apache.org>
Authored: Mon Apr 13 08:49:12 2015 +0530
Committer: Lahiru Sandaruwan <la...@apache.org>
Committed: Mon Apr 13 08:49:12 2015 +0530

----------------------------------------------------------------------
 .../logging/view/ui/LogViewerClient.java        |   34 +-
 .../src/main/resources/META-INF/component.xml   |    6 +-
 .../web/log-view/application_log_viewer.jsp     |  477 ++++----
 .../web/log-view/cassandra_log_viewer.jsp       |  885 +++++++-------
 .../resources/web/log-view/docs/userguide.html  |   61 +-
 .../web/log-view/download-ajaxprocessor.jsp     |  126 +-
 .../web/log-view/downloadgz-ajaxprocessor.jsp   |   96 +-
 .../src/main/resources/web/log-view/index.jsp   | 1081 +++++++++---------
 .../main/resources/web/log-view/index_old.jsp   |  228 ++--
 .../main/resources/web/log-view/js/logviewer.js |  726 ++++++------
 .../resources/web/log-view/syslog_index.jsp     |  650 +++++------
 .../src/main/resources/web/log-view/view.jsp    |  547 ++++-----
 12 files changed, 2497 insertions(+), 2420 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/f3355d97/components/org.apache.stratos.logging.view.ui/src/main/java/org/apache/stratos/logging/view/ui/LogViewerClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.logging.view.ui/src/main/java/org/apache/stratos/logging/view/ui/LogViewerClient.java b/components/org.apache.stratos.logging.view.ui/src/main/java/org/apache/stratos/logging/view/ui/LogViewerClient.java
index 5b0a9c5..c3da7cb 100644
--- a/components/org.apache.stratos.logging.view.ui/src/main/java/org/apache/stratos/logging/view/ui/LogViewerClient.java
+++ b/components/org.apache.stratos.logging.view.ui/src/main/java/org/apache/stratos/logging/view/ui/LogViewerClient.java
@@ -1,20 +1,20 @@
 /**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
-
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 
 package org.apache.stratos.logging.view.ui;
@@ -73,7 +73,7 @@ public class LogViewerClient {
     public void downloadArchivedLogFiles(String logFile, HttpServletResponse response, String domain, String serverKey)
             throws Exception {
         try {
-        	logFile=logFile.replace(".gz", "");
+            logFile = logFile.replace(".gz", "");
             ServletOutputStream outputStream = response.getOutputStream();
             response.setContentType("application/txt");
             response.setHeader("Content-Disposition",

http://git-wip-us.apache.org/repos/asf/stratos/blob/f3355d97/components/org.apache.stratos.logging.view.ui/src/main/resources/META-INF/component.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.logging.view.ui/src/main/resources/META-INF/component.xml b/components/org.apache.stratos.logging.view.ui/src/main/resources/META-INF/component.xml
index af9eb40..5ce1b15 100644
--- a/components/org.apache.stratos.logging.view.ui/src/main/resources/META-INF/component.xml
+++ b/components/org.apache.stratos.logging.view.ui/src/main/resources/META-INF/component.xml
@@ -17,7 +17,7 @@
     under the License.
 -->
 <component xmlns="http://products.wso2.org/carbon">
-        <!-- sample menu configuration -->
+    <!-- sample menu configuration -->
     <menus>
         <menu>
             <id>logs_menu</id>
@@ -32,7 +32,7 @@
             <require-permission>/permission/admin/monitor/logging</require-permission>
             <!--require-super-tenant>true</require-super-tenant-->
         </menu>
-         <menu>
+        <menu>
             <id>app_log_menu</id>
             <i18n-key>applogsmenutext</i18n-key>
             <i18n-bundle>org.apache.stratos.logging.view.ui.i18n.Resources</i18n-bundle>
@@ -43,7 +43,7 @@
             <style-class>monitor</style-class>
             <icon>../log-view/images/script_gear.gif</icon>
             <require-permission>/permission/admin/monitor/logging</require-permission>
-          
+
         </menu>
     </menus>
 </component>

http://git-wip-us.apache.org/repos/asf/stratos/blob/f3355d97/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/application_log_viewer.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/application_log_viewer.jsp b/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/application_log_viewer.jsp
index e8b1657..592c8d7 100644
--- a/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/application_log_viewer.jsp
+++ b/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/application_log_viewer.jsp
@@ -1,36 +1,36 @@
 <!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
 -->
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 <%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar"
-	prefix="carbon"%>
-<%@ page import="org.apache.stratos.logging.view.ui.LogViewerClient"%>
-<%@ page import="org.apache.axis2.context.ConfigurationContext"%>
-<%@ page import="org.wso2.carbon.CarbonConstants"%>
+           prefix="carbon" %>
+<%@ page import="org.apache.stratos.logging.view.ui.LogViewerClient" %>
+<%@ page import="org.apache.axis2.context.ConfigurationContext" %>
+<%@ page import="org.wso2.carbon.CarbonConstants" %>
 <%-- <%@ page --%>
-<!-- 	import="org.wso2.carbon.logging.view.stub.types.carbon.LogEvent"%> -->
-<%@ page import="org.wso2.carbon.utils.ServerConstants"%>
-<%@ page import="org.wso2.carbon.ui.CarbonUIUtil"%>
-<%@ page import="org.wso2.carbon.logging.view.stub.types.carbon.PaginatedLogEvent"%>
-<%@ page import="org.wso2.carbon.ui.CarbonUIMessage"%>
-<%@ page import="org.wso2.carbon.ui.CarbonUIUtil"%>
+<!-- import="org.wso2.carbon.logging.view.stub.types.carbon.LogEvent"%> -->
+<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
+<%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %>
+<%@ page import="org.wso2.carbon.logging.view.stub.types.carbon.PaginatedLogEvent" %>
+<%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %>
+<%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %>
 <%@ page import="org.wso2.carbon.ui.util.CharacterEncoder" %>
-<%@ page import="org.wso2.carbon.logging.view.stub.types.carbon.LogEvent"%>
+<%@ page import="org.wso2.carbon.logging.view.stub.types.carbon.LogEvent" %>
 <%@ page import="java.text.SimpleDateFormat" %>
 <script type="text/javascript" src="js/logviewer.js"></script>
 <script type="text/javascript" src="../admin/dialog/js/dialog.js"></script>
@@ -39,111 +39,111 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
 <head>
-<script type="text/JavaScript">
-	function refresh(time) {
-		setTimeout("location.reload(true);", time);
-	}
-</script>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>View Application Logs</title>
+    <script type="text/JavaScript">
+        function refresh(time) {
+            setTimeout("location.reload(true);", time);
+        }
+    </script>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>View Application Logs</title>
 </head>
 <body onload="JavaScript:refresh(120000);">
-	
-	<%
-		String backendServerURL = CarbonUIUtil
-				.getServerURL(config.getServletContext(), session);
-		ConfigurationContext configContext = (ConfigurationContext) config.getServletContext()
-				.getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
-		String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-		LogViewerClient logViewerClient;
-		LogEvent[] events = null;
-		String type;
-		String keyword;
-		String action;
-		String pageNumberStr = request.getParameter("pageNumber");
-		int pageNumber = 0;
-		int numberOfPages = 0;
-		PaginatedLogEvent paginatedLogEvents = null;
-		String parameter = "";
-        boolean isSuperTenant = CarbonUIUtil.isSuperTenant(request);
-        boolean isManager = false;
-        String tenantDomain = request.getParameter("tenantDomain");
-        String serviceName = request.getParameter("serviceName");
-        String showMaxStr = request.getParameter("showMax");
-        String serviceNames[];
-        boolean isValidTenant = true;
-        boolean showMax= false;
-        showMax = Boolean.parseBoolean(showMaxStr);
-        try {
-			pageNumber = Integer.parseInt(pageNumberStr);
-		} catch (NumberFormatException ignored) {
-			// page number format exception
-		}
-		String appName;
-		String applicationNames[] = null;
-		try {
-			type = CharacterEncoder.getSafeText(request.getParameter("type"));
-			type = (type == null) ? "":type;
-			keyword = CharacterEncoder.getSafeText(request.getParameter("keyword"));
-			keyword = (keyword == null )? "":keyword;
-			action = CharacterEncoder.getSafeText(request.getParameter("action"));
-			appName = request.getParameter("appName");
-			logViewerClient = new LogViewerClient(cookie, backendServerURL, configContext);
-            isValidTenant = logViewerClient.isValidTenant(tenantDomain);
-            if (tenantDomain == null) {
-                tenantDomain = "";
-            }
-            if (serviceName == null) {
-                serviceName = "";
-            }
-            if(isValidTenant) {
-                applicationNames = logViewerClient.getApplicationNames(tenantDomain, serviceName);
-                if (appName == null && applicationNames !=null  && applicationNames.length > 0) {
-                    appName = applicationNames[0];
-                }
-                if (applicationNames == null) {
-                    applicationNames = new String[]{"No applications"};
-                    appName = applicationNames[0];
-                } else if(applicationNames != null && applicationNames.length == 0) {
-                    applicationNames = new String[]{"No applications"};
-                    appName = applicationNames[0];
-                }
-                paginatedLogEvents = logViewerClient.getPaginatedApplicationLogEvents(pageNumber,type,keyword,appName, tenantDomain, serviceName);
+
+<%
+    String backendServerURL = CarbonUIUtil
+            .getServerURL(config.getServletContext(), session);
+    ConfigurationContext configContext = (ConfigurationContext) config.getServletContext()
+            .getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
+    String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+    LogViewerClient logViewerClient;
+    LogEvent[] events = null;
+    String type;
+    String keyword;
+    String action;
+    String pageNumberStr = request.getParameter("pageNumber");
+    int pageNumber = 0;
+    int numberOfPages = 0;
+    PaginatedLogEvent paginatedLogEvents = null;
+    String parameter = "";
+    boolean isSuperTenant = CarbonUIUtil.isSuperTenant(request);
+    boolean isManager = false;
+    String tenantDomain = request.getParameter("tenantDomain");
+    String serviceName = request.getParameter("serviceName");
+    String showMaxStr = request.getParameter("showMax");
+    String serviceNames[];
+    boolean isValidTenant = true;
+    boolean showMax = false;
+    showMax = Boolean.parseBoolean(showMaxStr);
+    try {
+        pageNumber = Integer.parseInt(pageNumberStr);
+    } catch (NumberFormatException ignored) {
+        // page number format exception
+    }
+    String appName;
+    String applicationNames[] = null;
+    try {
+        type = CharacterEncoder.getSafeText(request.getParameter("type"));
+        type = (type == null) ? "" : type;
+        keyword = CharacterEncoder.getSafeText(request.getParameter("keyword"));
+        keyword = (keyword == null) ? "" : keyword;
+        action = CharacterEncoder.getSafeText(request.getParameter("action"));
+        appName = request.getParameter("appName");
+        logViewerClient = new LogViewerClient(cookie, backendServerURL, configContext);
+        isValidTenant = logViewerClient.isValidTenant(tenantDomain);
+        if (tenantDomain == null) {
+            tenantDomain = "";
+        }
+        if (serviceName == null) {
+            serviceName = "";
+        }
+        if (isValidTenant) {
+            applicationNames = logViewerClient.getApplicationNames(tenantDomain, serviceName);
+            if (appName == null && applicationNames != null && applicationNames.length > 0) {
+                appName = applicationNames[0];
             }
             if (applicationNames == null) {
                 applicationNames = new String[]{"No applications"};
                 appName = applicationNames[0];
+            } else if (applicationNames != null && applicationNames.length == 0) {
+                applicationNames = new String[]{"No applications"};
+                appName = applicationNames[0];
             }
-            isManager = logViewerClient.isManager();
-            serviceNames = logViewerClient.getServiceNames();
-			if (paginatedLogEvents != null) {
-				events = paginatedLogEvents.getLogInfo();
-				numberOfPages = paginatedLogEvents.getNumberOfPages();
-			}
-			
-			parameter = "type=" + type + "&keyword=" + keyword+ "&appName="+appName;
-		} catch (Exception e) {
-			CarbonUIMessage.sendCarbonUIMessage(e.getMessage(), CarbonUIMessage.ERROR, request,
-					e);
-	%>
-	<script type="text/javascript">
-		location.href = "../admin/error.jsp";
-	</script>
-	<%
-		return;
-		}
-	%>
-	<fmt:bundle basename="org.apache.stratos.logging.view.ui.i18n.Resources">
-
-		<carbon:breadcrumb label="app.logs"
-			resourceBundle="org.wso2.carbon.logging.ui.i18n.Resources"
-			topPage="true" request="<%=request%>" />
-		<div id="middle">
-			<h2>
-				<fmt:message key="app.logs" />
-			</h2>
-			<div id="workArea">
+            paginatedLogEvents = logViewerClient.getPaginatedApplicationLogEvents(pageNumber, type, keyword, appName, tenantDomain, serviceName);
+        }
+        if (applicationNames == null) {
+            applicationNames = new String[]{"No applications"};
+            appName = applicationNames[0];
+        }
+        isManager = logViewerClient.isManager();
+        serviceNames = logViewerClient.getServiceNames();
+        if (paginatedLogEvents != null) {
+            events = paginatedLogEvents.getLogInfo();
+            numberOfPages = paginatedLogEvents.getNumberOfPages();
+        }
+
+        parameter = "type=" + type + "&keyword=" + keyword + "&appName=" + appName;
+    } catch (Exception e) {
+        CarbonUIMessage.sendCarbonUIMessage(e.getMessage(), CarbonUIMessage.ERROR, request,
+                e);
+%>
+<script type="text/javascript">
+    location.href = "../admin/error.jsp";
+</script>
+<%
+        return;
+    }
+%>
+<fmt:bundle basename="org.apache.stratos.logging.view.ui.i18n.Resources">
+
+    <carbon:breadcrumb label="app.logs"
+                       resourceBundle="org.wso2.carbon.logging.ui.i18n.Resources"
+                       topPage="true" request="<%=request%>"/>
+    <div id="middle">
+        <h2>
+            <fmt:message key="app.logs"/>
+        </h2>
 
+        <div id="workArea">
 
 
             <table border="0" class="styledLeft">
@@ -162,7 +162,8 @@
                                             type = "Custom";
                                     %>
 
-                                    <option value="<%=type%>" selected="true"><%=type%></option>
+                                    <option value="<%=type%>" selected="true"><%=type%>
+                                    </option>
 
                                     <%
                                         }
@@ -170,13 +171,15 @@
                                             if (logLevel.equals(type)) {
                                     %>
 
-                                    <option value="<%=logLevel%>" selected="true"><%=logLevel%></option>
+                                    <option value="<%=logLevel%>" selected="true"><%=logLevel%>
+                                    </option>
 
                                     <%
                                     } else {
                                     %>
 
-                                    <option value="<%=logLevel%>"><%=logLevel%></option>
+                                    <option value="<%=logLevel%>"><%=logLevel%>
+                                    </option>
 
                                     <%
                                             }
@@ -186,7 +189,7 @@
                                 <td style="padding-right: 2px !important;">
                                     <nobr><fmt:message key="application.name"/></nobr>
                                 </td>
-                                <td ><select
+                                <td><select
                                         name="appName" id="appName" return false;">
                                     <%
                                         for (String name : applicationNames) {
@@ -211,9 +214,10 @@
                                     %>
 
                                     </select></td>
-                                <td style="padding-right: 2px !important;"><nobr>
-                                    <fmt:message key="search.logs" />
-                                </nobr>
+                                <td style="padding-right: 2px !important;">
+                                    <nobr>
+                                        <fmt:message key="search.logs"/>
+                                    </nobr>
                                 </td>
                                 <td style="padding-right: 2px !important;">
                                     <input onkeypress="appSubmitenter(event)" value="<%=keyword%>"
@@ -231,12 +235,13 @@
                                                                                  class="button"-->
                                 </td>
                                 <td><input type="hidden" id="logkeyword"
-                                           name="KeyWord" value="<%=keyword%>" />
+                                           name="KeyWord" value="<%=keyword%>"/>
                                 </td>
                                 <td style="width: 17%;"></td>
-                                <td style="padding-right: 2px !important;"><nobr>
-                                    <fmt:message key="current.time" />
-                                </nobr>
+                                <td style="padding-right: 2px !important;">
+                                    <nobr>
+                                        <fmt:message key="current.time"/>
+                                    </nobr>
                                 </td>
                                 <%
                                     SimpleDateFormat dateFormat = new SimpleDateFormat("Z");
@@ -253,111 +258,119 @@
             </table>
 
 
+            <br/>
+            <table border="1" class="styledLeft">
 
-                   <br/>
-			<table border="1" class="styledLeft">
-		
-				<tbody>
+                <tbody>
 
-					<tr>
-						<td class="formRow">
+                <tr>
+                    <td class="formRow">
 
-							<table  class="styledLeft">
+                        <table class="styledLeft">
 
-                                <%
-                                    if(!isValidTenant) { %>
-                                <fmt:message key="invalid.tenant" />
-
-                                <%} else {
-
-
-								if (events == null || events.length == 0 || events[0] == null) {
-							%>
-								 <fmt:message key="no.logs" /> 
-							<%
- 								} else {
- 										int index = 0;
- 										for (LogEvent logMessage : events) {
- 											index++;
- 											if (index % 2 != 0) {
- 							%>
-                                <thead>
-                                <tr>
-                                    <th><b><fmt:message key="log.type" />
-                                    </b>
-                                    </th>
-                                    <th><b><fmt:message key="date" />
-                                    </b>
-                                    </th>
-                                    <th colspan="2"><b><fmt:message key="log.message" />
-                                    </b>
-                                    </th>
-                                </tr>
-                                </thead>
-								<tr>
-									<%
+                            <%
+                                if (!isValidTenant) { %>
+                            <fmt:message key="invalid.tenant"/>
+
+                            <%
+                            } else {
+
+
+                                if (events == null || events.length == 0 || events[0] == null) {
+                            %>
+                            <fmt:message key="no.logs"/>
+                            <%
+                            } else {
+                                int index = 0;
+                                for (LogEvent logMessage : events) {
+                                    index++;
+                                    if (index % 2 != 0) {
+                            %>
+                            <thead>
+                            <tr>
+                                <th><b><fmt:message key="log.type"/>
+                                </b>
+                                </th>
+                                <th><b><fmt:message key="date"/>
+                                </b>
+                                </th>
+                                <th colspan="2"><b><fmt:message key="log.message"/>
+                                </b>
+                                </th>
+                            </tr>
+                            </thead>
+                            <tr>
+                                        <%
 										} else {
 									%>
-								
-								<tr bgcolor="#eeeffb">
-									<%
-										}
-									%>
-								   <td border-bottom="gray" width="2%"><img
-										style="margin-right: 10px;"
-										src="<%=logViewerClient.getImageName(logMessage.getPriority().trim())%>">
-									</td>
-									<td><nobr><%=logMessage.getLogTime()%></nobr></td>
-									<td><%=CharacterEncoder.getSafeText(logMessage.getMessage())%></td>
-										<%
-											String imgId = "traceSymbolMax" + index;
-										%>
-									<td><a
-											class="icon-link"
-											style="background-image: url(images/plus.gif);"
-											href="javascript:showTrace(<%=index%>)"
-											id="<%=imgId%>"></a> <fmt:message
-												key="view.stack.trace" /></td>
-								</tr>
-								
-							<%
-																String id = "traceTable" + index;
-																			if (index % 2 != 0) {
-															%>
-									<tr id="<%=id%>" style="display: none" >
-									<%
+
+                            <tr bgcolor="#eeeffb">
+                                <%
+                                    }
+                                %>
+                                <td border-bottom="gray" width="2%"><img
+                                        style="margin-right: 10px;"
+                                        src="<%=logViewerClient.getImageName(logMessage.getPriority().trim())%>">
+                                </td>
+                                <td>
+                                    <nobr><%=logMessage.getLogTime()%>
+                                    </nobr>
+                                </td>
+                                <td><%=CharacterEncoder.getSafeText(logMessage.getMessage())%>
+                                </td>
+                                <%
+                                    String imgId = "traceSymbolMax" + index;
+                                %>
+                                <td><a
+                                        class="icon-link"
+                                        style="background-image: url(images/plus.gif);"
+                                        href="javascript:showTrace(<%=index%>)"
+                                        id="<%=imgId%>"></a> <fmt:message
+                                        key="view.stack.trace"/></td>
+                            </tr>
+
+                            <%
+                                String id = "traceTable" + index;
+                                if (index % 2 != 0) {
+                            %>
+                            <tr id="<%=id%>" style="display: none">
+                                        <%
 										} else {
 									%>
-								
-									<tr id="<%=id%>" style="display: none" bgcolor="#eeeffb">
-									<%
-										}
-									%>
 
-                                    <td colspan="4" width="100%">TID[<%=logMessage.getTenantId()%>] AppID[<%=logMessage.getAppName()%>] [<%=logMessage.getServerName()%>] [<%=logMessage.getLogTime()%>] <%=logMessage.getPriority().trim()%> {<%=logMessage.getLogger()%>} - <%=CharacterEncoder.getSafeText(logMessage.getMessage())%>
-                                        <%=logMessage.getStacktrace()%><br/>
-                                    </td>
-									</tr>
-							<%
-								}
-									}
+                            <tr id="<%=id%>" style="display: none" bgcolor="#eeeffb">
+                                <%
+                                    }
+                                %>
+
+                                <td colspan="4" width="100%">TID[<%=logMessage.getTenantId()%>]
+                                    AppID[<%=logMessage.getAppName()%>] [<%=logMessage.getServerName()%>]
+                                    [<%=logMessage.getLogTime()%>] <%=logMessage.getPriority().trim()%>
+                                    {<%=logMessage.getLogger()%>}
+                                    - <%=CharacterEncoder.getSafeText(logMessage.getMessage())%>
+                                    <%=logMessage.getStacktrace()%><br/>
+                                </td>
+                            </tr>
+                            <%
+                                        }
+                                    }
                                 }
-							%>
-							
-							</table>
-							 <carbon:paginator pageNumber="<%=pageNumber%>" numberOfPages="<%=numberOfPages%>"
-                      page="application_log_viewer.jsp" pageNumberParameterName="pageNumber"
-                      prevKey="prev" nextKey="next"
-                      parameters="<%= parameter%>"/>
-					</tr>
-					
-				</tbody>
-			</table>
-						</tr>
-					</tbody>
-				</table>
-			</div>
-		</div>
-	</fmt:bundle>
+                            %>
+
+                        </table>
+                            <carbon:paginator pageNumber="<%=pageNumber%>" numberOfPages="<%=numberOfPages%>"
+                                              page="application_log_viewer.jsp" pageNumberParameterName="pageNumber"
+                                              prevKey="prev" nextKey="next"
+                                              parameters="<%= parameter%>"/>
+                </tr>
+
+                </tbody>
+            </table>
+            </tr>
+            </tbody>
+            </table>
+        </div>
+    </div>
+</fmt:bundle>
 </body>
 </html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/f3355d97/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/cassandra_log_viewer.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/cassandra_log_viewer.jsp b/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/cassandra_log_viewer.jsp
index bc6f2b4..5f44c0d 100644
--- a/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/cassandra_log_viewer.jsp
+++ b/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/cassandra_log_viewer.jsp
@@ -1,35 +1,35 @@
 <!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
 -->
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 <%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar"
-	prefix="carbon"%>
-<%@ page import="org.apache.stratos.logging.view.ui.LogViewerClient"%>
-<%@ page import="org.apache.axis2.context.ConfigurationContext"%>
-<%@ page import="org.wso2.carbon.CarbonConstants"%>
+           prefix="carbon" %>
+<%@ page import="org.apache.stratos.logging.view.ui.LogViewerClient" %>
+<%@ page import="org.apache.axis2.context.ConfigurationContext" %>
+<%@ page import="org.wso2.carbon.CarbonConstants" %>
 <%-- <%@ page --%>
-<!-- 	import="org.wso2.carbon.logging.view.stub.types.carbon.LogEvent"%> -->
-<%@ page import="org.wso2.carbon.utils.ServerConstants"%>
-<%@ page import="org.wso2.carbon.ui.CarbonUIUtil"%>
+<!-- import="org.wso2.carbon.logging.view.stub.types.carbon.LogEvent"%> -->
+<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
+<%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %>
 
-<%@ page import="org.wso2.carbon.ui.CarbonUIMessage"%>
-<%@ page import="org.wso2.carbon.ui.CarbonUIUtil"%>
-<%@ page import="org.wso2.carbon.logging.view.stub.types.carbon.LogEvent"%>
+<%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %>
+<%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %>
+<%@ page import="org.wso2.carbon.logging.view.stub.types.carbon.LogEvent" %>
 <script type="text/javascript" src="js/logviewer.js"></script>
 <script type="text/javascript" src="../admin/dialog/js/dialog.js"></script>
 
@@ -37,411 +37,446 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>View System Logs</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>View System Logs</title>
 </head>
 <body>
-	<%
-		String backendServerURL = CarbonUIUtil
-				.getServerURL(config.getServletContext(), session);
-		ConfigurationContext configContext = (ConfigurationContext) config.getServletContext()
-				.getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
-		String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-		LogViewerClient logViewerClient;
-		LogEvent[] events;
-		String tenantDomain = "";
-		String serviceName = "WSO2 Stratos Manager";
-		boolean isLogsFromSyslog;
-		boolean isSTSyslog = false;
-		String serviceNames[];
-		boolean isManager = false;
-		boolean showManager = false;
-		String logIndex = request.getParameter("logIndex");
-		String start = request.getParameter("start");
-		
-		String end = request.getParameter("end");
-		boolean showTenantDomain = false;
-		boolean isStratosService = false;
-		tenantDomain = request.getParameter("tenantDomain");
-		serviceName = request.getParameter("serviceName");
-		Boolean isDateGiven=false;
-		String priority = request.getParameter("priority");
-		String logger = request.getParameter("logger");
-		String keyWord = request.getParameter("keyword");
+<%
+    String backendServerURL = CarbonUIUtil
+            .getServerURL(config.getServletContext(), session);
+    ConfigurationContext configContext = (ConfigurationContext) config.getServletContext()
+            .getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
+    String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+    LogViewerClient logViewerClient;
+    LogEvent[] events;
+    String tenantDomain = "";
+    String serviceName = "WSO2 Stratos Manager";
+    boolean isLogsFromSyslog;
+    boolean isSTSyslog = false;
+    String serviceNames[];
+    boolean isManager = false;
+    boolean showManager = false;
+    String logIndex = request.getParameter("logIndex");
+    String start = request.getParameter("start");
+
+    String end = request.getParameter("end");
+    boolean showTenantDomain = false;
+    boolean isStratosService = false;
+    tenantDomain = request.getParameter("tenantDomain");
+    serviceName = request.getParameter("serviceName");
+    Boolean isDateGiven = false;
+    String priority = request.getParameter("priority");
+    String logger = request.getParameter("logger");
+    String keyWord = request.getParameter("keyword");
 // 		LogEvent logs[];
-		if (start != null && !start.equals("null")&& !start.equals("")) {
-			isDateGiven=true;
-		}
-		int returnRows;
-		logIndex = (logIndex == null) ? "20" : logIndex;
-		tenantDomain = (tenantDomain == null) ? "" : tenantDomain;
-		start = (start == null) ? "" : start;
-		end = (end == null) ? "" : end;
-		priority = (priority == null) ? "ALL" : priority;
-		keyWord = (keyWord == null) ? "" : keyWord;
-		logger = (logger == null) ? "" : logger;
-		try {
-			returnRows = (logIndex == null) ? 20 : Integer.parseInt(logIndex);
-			logViewerClient = new LogViewerClient(cookie, backendServerURL, configContext);
-			isLogsFromSyslog = logViewerClient.isDataFromSysLog(tenantDomain);
-			isSTSyslog = logViewerClient.isSTSyslogConfig(tenantDomain);
-			isManager = logViewerClient.isManager();
-			serviceNames = logViewerClient.getServiceNames();;
-			serviceName = (serviceName == null) ? "WSO2 Stratos Manager" : serviceName;
-			tenantDomain = (tenantDomain == null) ? "" : tenantDomain;
-			isStratosService = logViewerClient.isStratosService();
-			showTenantDomain = (isSTSyslog && isLogsFromSyslog && isStratosService);
-			showManager = (isManager && isLogsFromSyslog);
-			events = logViewerClient.getSystemLogs(start, end,
-					logger, priority, "", serviceName, "", Integer.parseInt(logIndex));
-			System.out.println("events "+events);
-			System.out.println("Return Rows "+logIndex);
-			System.out.println("isDateGiven "+isDateGiven);
-			System.out.println("start "+start+" : "+start);
-			System.out.println("end "+end+" : "+end);
-			System.out.println("Priority "+priority);
-			System.out.println("Logger "+logger);
-			System.out.println("Keyword "+keyWord);
-		
-			System.out.println();
-			System.out.println();
-			
-			//	logs = logViewerClient.getAllLogs();
-		} catch (Exception e) {
-			CarbonUIMessage.sendCarbonUIMessage(e.getMessage(), CarbonUIMessage.ERROR, request,
-					e);
-	%>
-	<script type="text/javascript">
-		location.href = "../admin/error.jsp";
-	</script>
-	<%
-		return;
-		}
-	%>
-	<fmt:bundle basename="org.apache.stratos.logging.view.ui.i18n.Resources">
-
-		<carbon:breadcrumb label="system.logs"
-			resourceBundle="org.wso2.carbon.logging.ui.i18n.Resources"
-			topPage="true" request="<%=request%>" />
-		<div id="middle">
-			<h2>
-				<fmt:message key="system.logs" />
-			</h2>
-			<div id="workArea">
-			
-			<%
-				if (showTenantDomain || showManager) {
-			%>	<br /> <br />
-			<table border="0" class="styledLeft">
-				<tbody>
-					<tr>
-						<td>
-
-							<table class="normal">
-								<tr>
-									<%
-										if (showTenantDomain) {
-									%>
+    if (start != null && !start.equals("null") && !start.equals("")) {
+        isDateGiven = true;
+    }
+    int returnRows;
+    logIndex = (logIndex == null) ? "20" : logIndex;
+    tenantDomain = (tenantDomain == null) ? "" : tenantDomain;
+    start = (start == null) ? "" : start;
+    end = (end == null) ? "" : end;
+    priority = (priority == null) ? "ALL" : priority;
+    keyWord = (keyWord == null) ? "" : keyWord;
+    logger = (logger == null) ? "" : logger;
+    try {
+        returnRows = (logIndex == null) ? 20 : Integer.parseInt(logIndex);
+        logViewerClient = new LogViewerClient(cookie, backendServerURL, configContext);
+        isLogsFromSyslog = logViewerClient.isDataFromSysLog(tenantDomain);
+        isSTSyslog = logViewerClient.isSTSyslogConfig(tenantDomain);
+        isManager = logViewerClient.isManager();
+        serviceNames = logViewerClient.getServiceNames();
+        ;
+        serviceName = (serviceName == null) ? "WSO2 Stratos Manager" : serviceName;
+        tenantDomain = (tenantDomain == null) ? "" : tenantDomain;
+        isStratosService = logViewerClient.isStratosService();
+        showTenantDomain = (isSTSyslog && isLogsFromSyslog && isStratosService);
+        showManager = (isManager && isLogsFromSyslog);
+        events = logViewerClient.getSystemLogs(start, end,
+                logger, priority, "", serviceName, "", Integer.parseInt(logIndex));
+        System.out.println("events " + events);
+        System.out.println("Return Rows " + logIndex);
+        System.out.println("isDateGiven " + isDateGiven);
+        System.out.println("start " + start + " : " + start);
+        System.out.println("end " + end + " : " + end);
+        System.out.println("Priority " + priority);
+        System.out.println("Logger " + logger);
+        System.out.println("Keyword " + keyWord);
 
-									<td style="padding-right: 2px !important;"><nobr>
-											<fmt:message key="tenant.domain" />
-										</nobr>
-									</td>
-									<td style="padding-right: 2px !important;"><input
-										value="<%=tenantDomain%>" id="tenantDomain"
-										name="tenantDomain" size="20" type="text"></td>
-
-									<td style="padding-left: 0px !important;"><input
-										type="button" value="Get Tenant Logs"
-										onclick="javascript:getTenantSpecificIndex(); return false;"
-										class="button"></td>
-									<%
-										} else {
-									%>
-									<td><input type="hidden" id="tenantDomain"
-										name="tenantDomain" value="<%=tenantDomain%>" />
-									</td>
-									<%
-										}
-												if (showManager) {
-									%>
-									<td style="width: 100%;"></td>
-									<td style="width: 100%;"></td>
-									<td style="width: 100%;"></td>
-									<td style="padding-left: 0px !important;"><nobr>
-											<fmt:message key="service.name" />
-										</nobr>
-									</td>
-									<td style="width: 100%;"></td>
-									<td style="padding-left: 0px !important;"><select
-										name="serviceName" id="serviceName"
-										onchange="getProductTenantSpecificIndex()">
-											<%
-												for (String name : serviceNames) {
-											%>
-											<%
-												if (name.equals(serviceName)) {
-											%>
-											<option selected="selected" value="<%=name%>">
-												<%=name%>
-											</option>
-											<%
-												} else {
-											%>
-											<option value="<%=name%>">
-												<%=name%>
-											</option>
-											<%
-												}
-											%>
-											<%
-												}
-											%>
-
-									</select></td>
-									<%
-										} else {
-									%>
-									<input type="hidden" id="serviceName" name="serviceName"
-										value="<%=serviceName%>" />
-									<%
-										}
-									%>
-								</tr>
-
-
-							</table></td>
-					</tr>
-				</tbody>
-			</table><br /> <br />
-			<%
-				}
-			%>
-			
-				<table border="0" class="styledLeft">
-
-					<tbody>
-						<tr>
-							<td class="middle-header" colspan="2"><fmt:message key="filter.system.logs" />
-							</td>
-						</tr>
-						<tr>
-							<td>
-								<table class="normal-nopadding" width="100%">
-									<tr>
-										<td>
-											<table width="50%">
-												<tr>
-													<td><fmt:message key="return.rows" />
-													</td>
-													<td><select class="log-select" id="logIndex"
-														size="3">
-
-															<%
-													for (int i = 1; i < 201; i++) {
-													if (returnRows == i) {
-												%>
-															<option value="<%=i%>" selected="true"><%=i%></option>
-															<%
-													} else {
-												%>
-															<option value="<%=i%>"><%=i%></option>
-															<%
-													}
-														}
-												%>
-													</select>
-													</br></td>
-												</tr>
-												<tr>
-
-													<td><nobr>
-															<fmt:message key="show.at.or.before" />
-														</nobr></td>
-													<td style="padding-right: 2px !important;">
-											<%
-												if (!isDateGiven) {
-											%> <input type="radio" id="NowradioDate" name="radioDate" value="Now" checked>Now<br>
-											 <nobr>  <input type="radio" name="radioDate" id="NotNowradioDate"
-														value="<%=start+"_"+end%>"><input type="text"
-														id="start" name="start" value="<%=start%>" size="8" /> - <input
-														type="text" id=end name="end" value="<%=end%>"
-														size="8" /><fmt:message key="date.format" /> <br> <fmt:message key="date.example" /></nobr> <br>  <%
- 										} else {
- 										
-										 %> <input type="radio" id="NowradioDate"  name="radioDate" value="Now"> Now<br>
-										<nobr>	<input type="radio" name="radioDate"  id="NotNowradioDate"
-														value="<%=start+"_"+end%>" checked><input type="text"
-														id="start" name="start" value="<%=start%>" size="8" /> - <input
-														type="text" id="end" name="end" value="<%=end%>"
-														size="8" /><fmt:message key="date.format" />  <br> <fmt:message key="date.example" /></nobr> <br><%
-									
-												}
-											%>
-													</td>
-
-
-												</tr>
-
-											</table>
-										</td>
-									</tr>
-									<tr>
-										<td class="middle-header" colspan="2"><a
-											class="icon-link"
-											style="background-image: url(images/plus.gif);"
-											href="javascript:showQueryProperties()"
-											id="propertySymbolMax"></a> <fmt:message
-												key="advanced.properties" /></td>
-									</tr>
-									<tr id="propertyTable" style="display: none">
-										<td>
-											<table width="50%">
-												<tr>
-													<td><fmt:message key="logger" /></td>
-													<td><input type="text" size="30" id="logger"
-														name="logger" value="<%=logger%>" /></td>
-												</tr>
-												<tr>
-													<td><fmt:message key="priority" /></td>
-													<td><select class="log-select" id="logLevelID"
-														onchange="javascript:viewSingleSysLogLevel(); return false;">
-
-															<%
-															String[] logLevels = logViewerClient.getLogLevels();
-																	for (String logLevel : logLevels) {
-																		if (logLevel.equals(priority)) {
-															%>
-															<option value="<%=logLevel%>" selected="true"><%=logLevel%></option>
-															<%
-																} else {
-															%>
-															<option value="<%=logLevel%>"><%=logLevel%></option>
-															<%
-																}
-																	}
-															%>
-													</select></td>
-												</tr>
-												<tr>
-													<td><fmt:message key="keyword" /></td>
-													<td><input type="text" id="keyword" name="keyword"
-														value="<%=keyWord%>" /></td>
-												</tr>
-
-											</table>
-										</td>
-									</tr>
-									<tr>
-										<td style="padding-left: 0px !important;"><input
-											type="button" value="Search"
-											onclick="javascript:getFilteredLogs(); return false;"
-											class="button">
-										</td>
-									</tr>
-								</table></td>
-									<br />
-<%-- 				  	<carbon:paginator pageNumber="<%=pageNumber%>" numberOfPages="<%=numberOfPages%>" --%>
-<%--                                   page="view.jsp" pageNumberParameterName="pageNumber" parameters="<%=parameter%>"/>   --%>
-				<%
-				if (!isDateGiven) {
-			%>
-			<font color="blue"><fmt:message
-					key="view.logs.within.the.past.thirty.mins" />
-			</font>
-			<%
-				} else {
-			%>
-			<font color="blue"><fmt:message
-					key="view.logs.between" /><%=start%> and <%=end%>
-			</font>
-			<%
-				}
-			%><br/>
-			<table border="1" class="styledLeft">
-		
-				<tbody>
-
-					<tr>
-						<td class="formRow">
-
-							<table  class="styledLeft">
-							<thead>
-									<tr>
-										<th><b><fmt:message key="log.type" />
-										</b>
-										</th>
-										<th><b><fmt:message key="date" />
-										</b>
-										</th>
-										<th colspan="2"><b><fmt:message key="log.message" />
-										</b>
-										</th>
-									</tr>
-								</thead>
-							<%
-								if (events == null || events.length==0 || events[0] == null) {%>
-								 <fmt:message key="no.logs" /> 
-							<%} else {
-								int index=0;
-								for (LogEvent logMessage : events) {
-									index++;
-							    if (index % 2 != 0) {
-								%>
-								<tr>
-									<%
+        System.out.println();
+        System.out.println();
+
+        //	logs = logViewerClient.getAllLogs();
+    } catch (Exception e) {
+        CarbonUIMessage.sendCarbonUIMessage(e.getMessage(), CarbonUIMessage.ERROR, request,
+                e);
+%>
+<script type="text/javascript">
+    location.href = "../admin/error.jsp";
+</script>
+<%
+        return;
+    }
+%>
+<fmt:bundle basename="org.apache.stratos.logging.view.ui.i18n.Resources">
+
+    <carbon:breadcrumb label="system.logs"
+                       resourceBundle="org.wso2.carbon.logging.ui.i18n.Resources"
+                       topPage="true" request="<%=request%>"/>
+    <div id="middle">
+        <h2>
+            <fmt:message key="system.logs"/>
+        </h2>
+
+        <div id="workArea">
+
+            <%
+                if (showTenantDomain || showManager) {
+            %>    <br/> <br/>
+            <table border="0" class="styledLeft">
+                <tbody>
+                <tr>
+                    <td>
+
+                        <table class="normal">
+                            <tr>
+                                <%
+                                    if (showTenantDomain) {
+                                %>
+
+                                <td style="padding-right: 2px !important;">
+                                    <nobr>
+                                        <fmt:message key="tenant.domain"/>
+                                    </nobr>
+                                </td>
+                                <td style="padding-right: 2px !important;"><input
+                                        value="<%=tenantDomain%>" id="tenantDomain"
+                                        name="tenantDomain" size="20" type="text"></td>
+
+                                <td style="padding-left: 0px !important;"><input
+                                        type="button" value="Get Tenant Logs"
+                                        onclick="javascript:getTenantSpecificIndex(); return false;"
+                                        class="button"></td>
+                                <%
+                                } else {
+                                %>
+                                <td><input type="hidden" id="tenantDomain"
+                                           name="tenantDomain" value="<%=tenantDomain%>"/>
+                                </td>
+                                <%
+                                    }
+                                    if (showManager) {
+                                %>
+                                <td style="width: 100%;"></td>
+                                <td style="width: 100%;"></td>
+                                <td style="width: 100%;"></td>
+                                <td style="padding-left: 0px !important;">
+                                    <nobr>
+                                        <fmt:message key="service.name"/>
+                                    </nobr>
+                                </td>
+                                <td style="width: 100%;"></td>
+                                <td style="padding-left: 0px !important;"><select
+                                        name="serviceName" id="serviceName"
+                                        onchange="getProductTenantSpecificIndex()">
+                                    <%
+                                        for (String name : serviceNames) {
+                                    %>
+                                    <%
+                                        if (name.equals(serviceName)) {
+                                    %>
+                                    <option selected="selected" value="<%=name%>">
+                                        <%=name%>
+                                    </option>
+                                    <%
+                                    } else {
+                                    %>
+                                    <option value="<%=name%>">
+                                        <%=name%>
+                                    </option>
+                                    <%
+                                        }
+                                    %>
+                                    <%
+                                        }
+                                    %>
+
+                                </select></td>
+                                <%
+                                } else {
+                                %>
+                                <input type="hidden" id="serviceName" name="serviceName"
+                                       value="<%=serviceName%>"/>
+                                <%
+                                    }
+                                %>
+                            </tr>
+
+
+                        </table>
+                    </td>
+                </tr>
+                </tbody>
+            </table>
+            <br/> <br/>
+            <%
+                }
+            %>
+
+            <table border="0" class="styledLeft">
+
+                <tbody>
+                <tr>
+                    <td class="middle-header" colspan="2"><fmt:message key="filter.system.logs"/>
+                    </td>
+                </tr>
+                <tr>
+                    <td>
+                        <table class="normal-nopadding" width="100%">
+                            <tr>
+                                <td>
+                                    <table width="50%">
+                                        <tr>
+                                            <td><fmt:message key="return.rows"/>
+                                            </td>
+                                            <td><select class="log-select" id="logIndex"
+                                                        size="3">
+
+                                                <%
+                                                    for (int i = 1; i < 201; i++) {
+                                                        if (returnRows == i) {
+                                                %>
+                                                <option value="<%=i%>" selected="true"><%=i%>
+                                                </option>
+                                                <%
+                                                } else {
+                                                %>
+                                                <option value="<%=i%>"><%=i%>
+                                                </option>
+                                                <%
+                                                        }
+                                                    }
+                                                %>
+                                            </select>
+                                                </br></td>
+                                        </tr>
+                                        <tr>
+
+                                            <td>
+                                                <nobr>
+                                                    <fmt:message key="show.at.or.before"/>
+                                                </nobr>
+                                            </td>
+                                            <td style="padding-right: 2px !important;">
+                                                <%
+                                                    if (!isDateGiven) {
+                                                %> <input type="radio" id="NowradioDate" name="radioDate" value="Now"
+                                                          checked>Now<br>
+                                                <nobr><input type="radio" name="radioDate" id="NotNowradioDate"
+                                                             value="<%=start+"_"+end%>"><input type="text"
+                                                                                               id="start" name="start"
+                                                                                               value="<%=start%>"
+                                                                                               size="8"/> - <input
+                                                        type="text" id=end name="end" value="<%=end%>"
+                                                        size="8"/><fmt:message key="date.format"/> <br> <fmt:message
+                                                        key="date.example"/></nobr>
+                                                <br> <%
+                                            } else {
+
+                                            %> <input type="radio" id="NowradioDate" name="radioDate" value="Now">
+                                                Now<br>
+                                                <nobr><input type="radio" name="radioDate" id="NotNowradioDate"
+                                                             value="<%=start+"_"+end%>" checked><input type="text"
+                                                                                                       id="start"
+                                                                                                       name="start"
+                                                                                                       value="<%=start%>"
+                                                                                                       size="8"/> -
+                                                    <input
+                                                            type="text" id="end" name="end" value="<%=end%>"
+                                                            size="8"/><fmt:message key="date.format"/> <br> <fmt:message
+                                                            key="date.example"/></nobr>
+                                                <br><%
+
+                                                }
+                                            %>
+                                            </td>
+
+
+                                        </tr>
+
+                                    </table>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td class="middle-header" colspan="2"><a
+                                        class="icon-link"
+                                        style="background-image: url(images/plus.gif);"
+                                        href="javascript:showQueryProperties()"
+                                        id="propertySymbolMax"></a> <fmt:message
+                                        key="advanced.properties"/></td>
+                            </tr>
+                            <tr id="propertyTable" style="display: none">
+                                <td>
+                                    <table width="50%">
+                                        <tr>
+                                            <td><fmt:message key="logger"/></td>
+                                            <td><input type="text" size="30" id="logger"
+                                                       name="logger" value="<%=logger%>"/></td>
+                                        </tr>
+                                        <tr>
+                                            <td><fmt:message key="priority"/></td>
+                                            <td><select class="log-select" id="logLevelID"
+                                                        onchange="javascript:viewSingleSysLogLevel(); return false;">
+
+                                                <%
+                                                    String[] logLevels = logViewerClient.getLogLevels();
+                                                    for (String logLevel : logLevels) {
+                                                        if (logLevel.equals(priority)) {
+                                                %>
+                                                <option value="<%=logLevel%>" selected="true"><%=logLevel%>
+                                                </option>
+                                                <%
+                                                } else {
+                                                %>
+                                                <option value="<%=logLevel%>"><%=logLevel%>
+                                                </option>
+                                                <%
+                                                        }
+                                                    }
+                                                %>
+                                            </select></td>
+                                        </tr>
+                                        <tr>
+                                            <td><fmt:message key="keyword"/></td>
+                                            <td><input type="text" id="keyword" name="keyword"
+                                                       value="<%=keyWord%>"/></td>
+                                        </tr>
+
+                                    </table>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td style="padding-left: 0px !important;"><input
+                                        type="button" value="Search"
+                                        onclick="javascript:getFilteredLogs(); return false;"
+                                        class="button">
+                                </td>
+                            </tr>
+                        </table>
+                    </td>
+                    <br/>
+                        <%-- 				  	<carbon:paginator pageNumber="<%=pageNumber%>" numberOfPages="<%=numberOfPages%>" --%>
+                        <%--                                   page="view.jsp" pageNumberParameterName="pageNumber" parameters="<%=parameter%>"/>   --%>
+                    <%
+                        if (!isDateGiven) {
+                    %>
+                    <font color="blue"><fmt:message
+                            key="view.logs.within.the.past.thirty.mins"/>
+                    </font>
+                    <%
+                    } else {
+                    %>
+                    <font color="blue"><fmt:message
+                            key="view.logs.between"/><%=start%> and <%=end%>
+                    </font>
+                    <%
+                        }
+                    %><br/>
+                    <table border="1" class="styledLeft">
+
+                        <tbody>
+
+                        <tr>
+                            <td class="formRow">
+
+                                <table class="styledLeft">
+                                    <thead>
+                                    <tr>
+                                        <th><b><fmt:message key="log.type"/>
+                                        </b>
+                                        </th>
+                                        <th><b><fmt:message key="date"/>
+                                        </b>
+                                        </th>
+                                        <th colspan="2"><b><fmt:message key="log.message"/>
+                                        </b>
+                                        </th>
+                                    </tr>
+                                    </thead>
+                                    <%
+                                        if (events == null || events.length == 0 || events[0] == null) {%>
+                                    <fmt:message key="no.logs"/>
+                                    <%
+                                    } else {
+                                        int index = 0;
+                                        for (LogEvent logMessage : events) {
+                                            index++;
+                                            if (index % 2 != 0) {
+                                    %>
+                                    <tr>
+                                                <%
 										} else {
 									%>
-								
-								<tr bgcolor="#eeeffb">
-									<%
-										}%>
-								   <td border-bottom="gray" width="2%"><img
-										style="margin-right: 10px;"
-										src="<%=logViewerClient.getImageName(logMessage.getPriority().trim())%>">
-									</td>
-									<td><nobr><%=logMessage.getLogTime()%></nobr></td>
-									<td><%=logMessage.getMessage()%></td>
-										<%String imgId = "traceSymbolMax"+index; %>
-									<td><a
-											class="icon-link"
-											style="background-image: url(images/plus.gif);"
-											href="javascript:showTrace(<%=index%>)"
-											id="<%=imgId%>"></a> <fmt:message
-												key="view.stack.trace" /></td>
-								</tr>
-								
-							<%String id = "traceTable"+index;   if (index % 2 != 0) {
-								%>
-									<tr id="<%=id%>" style="display: none" >
-									<%
+
+                                    <tr bgcolor="#eeeffb">
+                                        <%
+                                            }%>
+                                        <td border-bottom="gray" width="2%"><img
+                                                style="margin-right: 10px;"
+                                                src="<%=logViewerClient.getImageName(logMessage.getPriority().trim())%>">
+                                        </td>
+                                        <td>
+                                            <nobr><%=logMessage.getLogTime()%>
+                                            </nobr>
+                                        </td>
+                                        <td><%=logMessage.getMessage()%>
+                                        </td>
+                                        <%String imgId = "traceSymbolMax" + index; %>
+                                        <td><a
+                                                class="icon-link"
+                                                style="background-image: url(images/plus.gif);"
+                                                href="javascript:showTrace(<%=index%>)"
+                                                id="<%=imgId%>"></a> <fmt:message
+                                                key="view.stack.trace"/></td>
+                                    </tr>
+
+                                    <%
+                                        String id = "traceTable" + index;
+                                        if (index % 2 != 0) {
+                                    %>
+                                    <tr id="<%=id%>" style="display: none">
+                                                <%
 										} else {
 									%>
-								
-									<tr id="<%=id%>" style="display: none" bgcolor="#eeeffb">
-									<%
-									}%>
-								
-									<td colspan="4" width="100%">[<%=logMessage.getServerName()%>] [<%=logMessage.getLogTime()%>] <%=logMessage.getPriority().trim()%> {<%=logMessage.getLogger()%>} - <%=logMessage.getMessage()%> 
-										<%=logMessage.getStacktrace()%><br/>
-									</td>
-									</tr>
-							<%}
-								}
-							%>
-							
-							</table>
-					</tr>
-<%-- 					<tr><carbon:paginator pageNumber="<%=pageNumber%>" numberOfPages="<%=numberOfPages%>" --%>
-<%--                                   page="view.jsp" pageNumberParameterName="pageNumber" parameters="<%=parameter%>"/> <tr>  --%>
-					
-				</tbody>
-			</table>
-						</tr>
-					</tbody>
-				</table>
-			</div>
-		</div>
-	</fmt:bundle>
+
+                                    <tr id="<%=id%>" style="display: none" bgcolor="#eeeffb">
+                                        <%
+                                            }%>
+
+                                        <td colspan="4" width="100%">[<%=logMessage.getServerName()%>]
+                                            [<%=logMessage.getLogTime()%>] <%=logMessage.getPriority().trim()%>
+                                            {<%=logMessage.getLogger()%>} - <%=logMessage.getMessage()%>
+                                            <%=logMessage.getStacktrace()%><br/>
+                                        </td>
+                                    </tr>
+                                    <%
+                                            }
+                                        }
+                                    %>
+
+                                </table>
+                        </tr>
+                            <%-- 					<tr><carbon:paginator pageNumber="<%=pageNumber%>" numberOfPages="<%=numberOfPages%>" --%>
+                            <%--                                   page="view.jsp" pageNumberParameterName="pageNumber" parameters="<%=parameter%>"/> <tr>  --%>
+
+                        </tbody>
+                    </table>
+                </tr>
+                </tbody>
+            </table>
+        </div>
+    </div>
+</fmt:bundle>
 </body>
 </html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/f3355d97/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/docs/userguide.html
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/docs/userguide.html b/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/docs/userguide.html
index 0311f3a..41a9a3c 100644
--- a/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/docs/userguide.html
+++ b/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/docs/userguide.html
@@ -19,59 +19,72 @@
 -->
 <html>
 <head>
-  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"/>
-  <title>Monitor Logs - User Guide</title>
-  <link href="../../admin/css/documentation.css" rel="stylesheet" type="text/css" media="all" />
-</head> 
- 
+    <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"/>
+    <title>Monitor Logs - User Guide</title>
+    <link href="../../admin/css/documentation.css" rel="stylesheet" type="text/css" media="all"/>
+</head>
+
 <body>
 <h1>Monitor Logs</h1>
 
-<p>Logs can be displayed as System logs or application logs.System Logs shows the log events of the system logs depending on the product. Application logs filter logs by the application, it can be services or web applications. There are two ways to configure system logs, 1) through Memory Appender where logs will be taken from the memory, 2) BAMLogEventAppender where logs will be published to bam and log events will be taken from BAM storages. Only the latest daily logs messages will be displayed in the UI where the logs events can be filtered accordingly. Log events are archived daily per tenant per product per date and can be downloaded for further analysis.
+<p>Logs can be displayed as System logs or application logs.System Logs shows the log events of the system logs
+    depending on the product. Application logs filter logs by the application, it can be services or web applications.
+    There are two ways to configure system logs, 1) through Memory Appender where logs will be taken from the memory, 2)
+    BAMLogEventAppender where logs will be published to bam and log events will be taken from BAM storages. Only the
+    latest daily logs messages will be displayed in the UI where the logs events can be filtered accordingly. Log events
+    are archived daily per tenant per product per date and can be downloaded for further analysis.
 </p>
+
 <p>The log messages, displayed in this page are obtained from a memory appender. Hence, the severity(log level) of the
     displayed log messages are equal or higher than the threshold of the memory appender. For more information on
     appenders, loggers and their log levels, please visit <a href="http://logging.apache.org/log4j/">here</a>. </p>
 
 <h3><strong>Log files on disk</strong></h3>
+
 <p>The location of the log files on disk is specified in the log4j.configuration file.</p>
 
 <h2>View Logs</h2>
 
 <p>This log events are displayed from bottom-up manner. You can also search for a
-particular log by a keyword using the <span style="font-weight: bold;">Search Logs</span>
-feature. <span style="color: red;"></span></p>
+    particular log by a keyword using the <span style="font-weight: bold;">Search Logs</span>
+    feature. <span style="color: red;"></span></p>
 <ol>
-  <li>In the navigator, under Monitor, click <span
-    style="font-weight: bold;">Logs</span>. The <span
-    style="font-style: italic; font-weight: bold;">System Logs/Application Logs</span> page
-    appears.�</li>
+    <li>In the navigator, under Monitor, click <span
+            style="font-weight: bold;">Logs</span>. The <span
+            style="font-style: italic; font-weight: bold;">System Logs/Application Logs</span> page
+        appears.�
+    </li>
 
-  <li>In the <span style="font-weight: bold;">View</span> list, select the
-    category of logs you want to view. The available categories are,  </li>
+    <li>In the <span style="font-weight: bold;">View</span> list, select the
+        category of logs you want to view. The available categories are,
+    </li>
 </ol>
 
 <div style="margin-left: 40px;">
-INFO �- Information messages
-WARN �- Warning messages
-ERROR �- Error messages
-DEBUG �- Debug messages 
-TRACE �- Trace messages
-FATAL -�Fatal error messages </div>
+    INFO �- Information messages
+    WARN �- Warning messages
+    ERROR �- Error messages
+    DEBUG �- Debug messages
+    TRACE �- Trace messages
+    FATAL -�Fatal error messages
+</div>
 <ol>
 </ol>
 
-<p><img alt="" src="images/logview.jpg" /></p>
+<p><img alt="" src="images/logview.jpg"/></p>
 
 <p style="text-align:left;">Figure 1: Monitor Logs</p>
 
-<p><img alt="" src="images/logIndex.jpg" /></p>
+<p><img alt="" src="images/logIndex.jpg"/></p>
+
 <p style="text-align:left;">Figure 2: Archived Logs</p>
 
-<p>To filter out application specific logs, go to Monitor -> Application Logs. This will display application specific logs.</p>
+<p>To filter out application specific logs, go to Monitor -> Application Logs. This will display application specific
+    logs.</p>
+
 
+<p><img alt="" src="images/application.jpg"/></p>
 
-<p><img alt="" src="images/application.jpg" /></p>
 <p style="text-align:left;">Figure 3: Application Logs</p>
 </body>
 </html>

http://git-wip-us.apache.org/repos/asf/stratos/blob/f3355d97/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/download-ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/download-ajaxprocessor.jsp b/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/download-ajaxprocessor.jsp
index 171a80a..1faff1c 100755
--- a/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/download-ajaxprocessor.jsp
+++ b/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/download-ajaxprocessor.jsp
@@ -1,23 +1,23 @@
 <!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
 
-     http://www.apache.org/licenses/LICENSE-2.0
+http://www.apache.org/licenses/LICENSE-2.0
 
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
 -->
 
-<%@page import="java.io.OutputStreamWriter"%>
+<%@page import="java.io.OutputStreamWriter" %>
 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 <%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %>
 <%@ page import="org.apache.stratos.logging.view.ui.LogViewerClient" %>
@@ -31,58 +31,58 @@
 <script type="text/javascript" src="js/logviewer.js"></script>
 <script type="text/javascript" src="../admin/dialog/js/dialog.js"></script>
 <%
-	String backendServerURL = CarbonUIUtil
-			.getServerURL(config.getServletContext(), session);
-	ConfigurationContext configContext = (ConfigurationContext) config.getServletContext()
-			.getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
-	String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-	LogViewerClient logViewerClient;
-	String message = "";
-	String tenantDomain ="";
-	String serviceName = "WSO2 Stratos Manager";
-	String downloadFile = request.getParameter("logFile");
-	try {
-		out.clear();
-		out = pageContext.pushBody();
-		out.clearBuffer();
-		ServletOutputStream outputStream = response.getOutputStream();
-		response.setContentType("application/txt");
-		response.setHeader("Content-Disposition", "attachment;filename=" + downloadFile.replaceAll("\\s", "_"));
-		logViewerClient = new LogViewerClient(cookie, backendServerURL, configContext);
-		OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream);
-		tenantDomain = request.getParameter("tenantDomain");
-		serviceName = request.getParameter("serviceName");
-		tenantDomain = (tenantDomain == null) ? "" : tenantDomain;
-		serviceName = (serviceName == null) ? "WSO2 Stratos Manager" : serviceName;
-		int fileSize = logViewerClient.getLineNumbers(downloadFile) + 1;
-	    System.out.println("fileSize "+fileSize);
-		int pages = (int) Math.ceil((double) fileSize / 2000);
-	
-		for (int i = 0; i < pages; i++) {
-			int start = (i * 2000) + 1;
-			int end = start + 2000;
-			String logIndex = Integer.toString(fileSize);
-			String logs[] = logViewerClient.getLogLinesFromFile(downloadFile, fileSize,
-					start, end);
-			for (String logMessage : logs) {
-				outputStreamWriter.write(logMessage + "\n");
-			}
+    String backendServerURL = CarbonUIUtil
+            .getServerURL(config.getServletContext(), session);
+    ConfigurationContext configContext = (ConfigurationContext) config.getServletContext()
+            .getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
+    String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+    LogViewerClient logViewerClient;
+    String message = "";
+    String tenantDomain = "";
+    String serviceName = "WSO2 Stratos Manager";
+    String downloadFile = request.getParameter("logFile");
+    try {
+        out.clear();
+        out = pageContext.pushBody();
+        out.clearBuffer();
+        ServletOutputStream outputStream = response.getOutputStream();
+        response.setContentType("application/txt");
+        response.setHeader("Content-Disposition", "attachment;filename=" + downloadFile.replaceAll("\\s", "_"));
+        logViewerClient = new LogViewerClient(cookie, backendServerURL, configContext);
+        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream);
+        tenantDomain = request.getParameter("tenantDomain");
+        serviceName = request.getParameter("serviceName");
+        tenantDomain = (tenantDomain == null) ? "" : tenantDomain;
+        serviceName = (serviceName == null) ? "WSO2 Stratos Manager" : serviceName;
+        int fileSize = logViewerClient.getLineNumbers(downloadFile) + 1;
+        System.out.println("fileSize " + fileSize);
+        int pages = (int) Math.ceil((double) fileSize / 2000);
 
-		}
-		outputStreamWriter.flush();
-		outputStream.flush();
-		out.flush();
+        for (int i = 0; i < pages; i++) {
+            int start = (i * 2000) + 1;
+            int end = start + 2000;
+            String logIndex = Integer.toString(fileSize);
+            String logs[] = logViewerClient.getLogLinesFromFile(downloadFile, fileSize,
+                    start, end);
+            for (String logMessage : logs) {
+                outputStreamWriter.write(logMessage + "\n");
+            }
+
+        }
+        outputStreamWriter.flush();
+        outputStream.flush();
+        out.flush();
         outputStreamWriter.close();
         outputStream.close();
         out.close();
-	} catch (Exception e) {
-		CarbonUIMessage.sendCarbonUIMessage(e.getMessage(), CarbonUIMessage.ERROR, request,
-				e);
+    } catch (Exception e) {
+        CarbonUIMessage.sendCarbonUIMessage(e.getMessage(), CarbonUIMessage.ERROR, request,
+                e);
 %>
-        <script type="text/javascript">
-               location.href = "../admin/error.jsp";
-        </script>
+<script type="text/javascript">
+    location.href = "../admin/error.jsp";
+</script>
 <%
-	return;
-	}
+        return;
+    }
 %>

http://git-wip-us.apache.org/repos/asf/stratos/blob/f3355d97/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/downloadgz-ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/downloadgz-ajaxprocessor.jsp b/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/downloadgz-ajaxprocessor.jsp
index 23164ec..26bfee8 100755
--- a/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/downloadgz-ajaxprocessor.jsp
+++ b/components/org.apache.stratos.logging.view.ui/src/main/resources/web/log-view/downloadgz-ajaxprocessor.jsp
@@ -1,23 +1,23 @@
 <!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
 
-     http://www.apache.org/licenses/LICENSE-2.0
+http://www.apache.org/licenses/LICENSE-2.0
 
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
 -->
 
-<%@page import="java.io.OutputStreamWriter"%>
+<%@page import="java.io.OutputStreamWriter" %>
 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 <%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %>
 <%@ page import="org.apache.stratos.logging.view.ui.LogViewerClient" %>
@@ -31,39 +31,39 @@
 <script type="text/javascript" src="js/logviewer.js"></script>
 <script type="text/javascript" src="../admin/dialog/js/dialog.js"></script>
 <%
-	String backendServerURL = CarbonUIUtil
-			.getServerURL(config.getServletContext(), session);
-	ConfigurationContext configContext = (ConfigurationContext) config.getServletContext()
-			.getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
-	String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-	LogViewerClient logViewerClient;
-	String message = "";
-	String tenantDomain ="";
-	String serviceName = "WSO2 Stratos Manager";
-	String downloadFile = request.getParameter("logFile");
-	String fileName = downloadFile;
-	//String fileName = downloadFile.replace(".gz","");
-	try {
-		out.clear();
-		out = pageContext.pushBody();
-		out.clearBuffer();
-		tenantDomain = request.getParameter("tenantDomain");
-		serviceName = request.getParameter("serviceName");
-		tenantDomain = (tenantDomain == null) ? "" : tenantDomain;
-		serviceName = (serviceName == null) ? "WSO2 Stratos Manager" : serviceName;
-		logViewerClient = new LogViewerClient(cookie, backendServerURL, configContext);
-	    logViewerClient.downloadArchivedLogFiles(fileName,response, tenantDomain, serviceName);
-	   
-		//out.flush();
-       //  out.close();
-	} catch (Exception e) {
-		CarbonUIMessage.sendCarbonUIMessage(e.getMessage(), CarbonUIMessage.ERROR, request,
-				e);
+    String backendServerURL = CarbonUIUtil
+            .getServerURL(config.getServletContext(), session);
+    ConfigurationContext configContext = (ConfigurationContext) config.getServletContext()
+            .getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
+    String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+    LogViewerClient logViewerClient;
+    String message = "";
+    String tenantDomain = "";
+    String serviceName = "WSO2 Stratos Manager";
+    String downloadFile = request.getParameter("logFile");
+    String fileName = downloadFile;
+    //String fileName = downloadFile.replace(".gz","");
+    try {
+        out.clear();
+        out = pageContext.pushBody();
+        out.clearBuffer();
+        tenantDomain = request.getParameter("tenantDomain");
+        serviceName = request.getParameter("serviceName");
+        tenantDomain = (tenantDomain == null) ? "" : tenantDomain;
+        serviceName = (serviceName == null) ? "WSO2 Stratos Manager" : serviceName;
+        logViewerClient = new LogViewerClient(cookie, backendServerURL, configContext);
+        logViewerClient.downloadArchivedLogFiles(fileName, response, tenantDomain, serviceName);
+
+        //out.flush();
+        //  out.close();
+    } catch (Exception e) {
+        CarbonUIMessage.sendCarbonUIMessage(e.getMessage(), CarbonUIMessage.ERROR, request,
+                e);
 %>
-        <script type="text/javascript">
-               location.href = "../admin/error.jsp";
-        </script>
+<script type="text/javascript">
+    location.href = "../admin/error.jsp";
+</script>
 <%
-	return;
-	}
+        return;
+    }
 %>