📄 viewlogsystem.jsp
字号:
<%--
- $Header: /cvsroot/mvnforum/mvnforum/srcweb/mvnplugin/mvnforum/admin/viewlogsystem.jsp,v 1.22.2.1 2006/07/10 12:59:21 phuongpdd Exp $
- $Author: phuongpdd $
- $Revision: 1.22.2.1 $
- $Date: 2006/07/10 12:59:21 $
-
- ====================================================================
-
- Copyright (C) 2002-2006 by MyVietnam.net
-
- All copyright notices regarding mvnForum MUST remain
- intact in the scripts and in the outputted HTML.
- The "powered by" text/logo with a link back to
- http://www.mvnForum.com and http://www.MyVietnam.net in
- the footer of the pages MUST remain visible when the pages
- are viewed on the internet or intranet.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Support can be obtained from support forums at:
- http://www.mvnForum.com/mvnforum/index
-
- Correspondence and Marketing Questions can be sent to:
- info at MyVietnam net
-
- @author: Minh Nguyen
- @author: Mai Nguyen
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page errorPage="fatalerror.jsp"%>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="net.myvietnam.mvncore.util.*" %>
<%@ page import="com.mvnforum.db.*" %>
<%@ page import="com.mvnforum.MVNForumConstant" %>
<%@ page import="com.mvnforum.MVNForumConfig" %>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ include file="inc_common.jsp"%>
<fmt:bundle basename="mvnForum_i18n">
<html>
<head>
<title><fmt:message key="mvnforum.common.forum.title_name"/> - <fmt:message key="mvnforum.admin.index.viewlogsystem"/><!--Log File Management--></title>
<%@ include file="/mvnplugin/mvnforum/meta.jsp"%>
<link href="<%=onlineUser.getCssPath()%>" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<%@ include file="inc_js_checkvalid_myvietnamlib.jsp"%>
<%@ include file="header.jsp"%>
<br/>
<%
String logs[] = {"ALL", "TRACE", "DEBUG", "INFO", "WARN" , "ERROR", "FATAL"};
String logValues[] = {"All", "Only Trace", "Only Debug", "Only Info", "Only Warn", "Only Error", "Only Fatal"};
int lineNums[] = { 25, 50 , 100, 200, 400, 800 };
int lineCount = ParamUtil.getParameterInt(request, "linecount", 25);
String log = ParamUtil.getParameterFilter(request, "log");
if (log.length() == 0 ) {
log = "ALL";
}
String logDir = ParamUtil.getAttribute(request, "LogDir");
String logFileName = ParamUtil.getAttribute(request, "LogFileName");
String logFileSize = ParamUtil.getAttribute(request, "LogFileSize");
String logFileHumanSize = ParamUtil.getAttribute(request, "LogFileHumanSize");
String fileName = ParamUtil.getAttribute(request, "FileName");
%>
<table width="98%" align="center">
<tr class="nav">
<td><img src="<%=contextPath%>/mvnplugin/mvnforum/images/nav.gif"></td>
<td width="100%" nowrap>
<a class="nav" href="<%=urlResolver.encodeURL(request, response, "index", URLResolver.RENDER_URL, "view")%>"><fmt:message key="mvnforum.common.nav.index"/></a> »
<a class="nav" href="<%=urlResolver.encodeURL(request, response, "index")%>"><fmt:message key="mvnforum.admin.index.title_name"/><!--Admin CP--></a> »
<fmt:message key="mvnforum.admin.index.viewlogsystem"/><!--Log File Management-->
</td>
</tr>
</table>
<br/>
<table class="tborder" width="98%" cellspacing="1" cellpadding="3" align="center">
<tr class="pagedesc">
<td>
<b><fmt:message key="mvnforum.admin.index.viewlogsystem"/><!--Log File Management--></b>
<fmt:message key="mvnforum.admin.log.DSC"/>
<!--
is a place that you can manage your log files. You should config the log file first.
If you choose <a href="http://logging.apache.org/log4j/docs/">Log4j</a>, then config file log4j.properties.
Or if you choose <a href="http://jlo.jzonic.org">Jlo</a>, please config file jlo_logging.xml.
Please note that Log4j is more common and should be used, however, sometime Log4j could not work on JRun 4 or Tomcat 5,
Tomcat 5.5, then you should use Jlo as an alternative logging solution.<br/>
After that, you have to config mvnforum.xml to let mvnForum know your current log file. Please note that the log
file must be in folder mvnForumHome/log to let mvnForum work properly.<br/>
With this log management tool, you can view content of the current log file (show all or with filer). You can backup the log file
to the log directory. Usually, when backup the log file, you should empty it to reduce the log file size. You can
list all archieved log files, download them or delete them if you want.
-->
<br/>
<fmt:message key="mvnforum.common.prompt.choose_tasks"/>:<br/>
<a href="<%=urlResolver.encodeURL(request, response, "listlogfiles")%>" class='command'><fmt:message key="mvnforum.admin.log.listLogFiles"/><!--List log files--></a> <fmt:message key="mvnforum.admin.log.listLogFiles.remark"/><!--(you can also download or delete archieved log files)--><br/>
<a href="<%=urlResolver.encodeURL(request, response, "backupsystemlog")%>" class='command'><fmt:message key="mvnforum.admin.log.backupLog"/><!--Backup the system log--></a> <fmt:message key="mvnforum.admin.log.backupLog.remark"/><!--(take a few minutes. Depend on the system log size)--><br/>
<a href="<%=urlResolver.encodeURL(request, response, "backupsystemlog?empty=yes")%>" class='command'><fmt:message key="mvnforum.admin.log.backupLogThenEmpty"/><!--Backup the system log then empty the file--></a><fmt:message key="mvnforum.admin.log.backupLogThenEmpty.remark"/> <!--(take a few minutes. Depend on the system log size)-->
</td>
</tr>
</table>
<br/>
<form action="<%=urlResolver.encodeURL(request, response, "viewlogsystem")%>" name="submitform">
<%=urlResolver.generateFormAction(request, response, "viewlogsystem")%>
<input type="hidden" name="filename" value="<%=fileName%>">
<table class="tborder" width="98%" cellspacing="1" cellpadding="3" align="center">
<tr class="portlet-section-header">
<td colspan="2"><fmt:message key="mvnforum.admin.log.logFileInformation"/><!--Log file Information-->:</td>
</tr>
<tr class="portlet-section-body">
<td><fmt:message key="mvnforum.admin.log.logFileInformation.fileDirectory"/><!--File directory-->:</td>
<td class="portlet-font"><%=logDir%></td>
</tr>
<tr class="portlet-section-alternate">
<td><fmt:message key="mvnforum.admin.log.logFileInformation.fileLogName"/><!--File log name-->:</td>
<td class="portlet-font"><%=logFileName%></td>
</tr>
<tr class="portlet-section-body">
<td><fmt:message key="mvnforum.admin.log.logFileInformation.fileLogSize"/><!--File log size-->:</td>
<td class="portlet-font"><%=logFileHumanSize%> (<%=logFileSize%> bytes)</td>
</tr>
<tr class="portlet-section-alternate">
<td><fmt:message key="mvnforum.admin.log.logFileInformation.linesYouWantView"/><!--How many lines do you want to view?--></td>
<td>
<select name="linecount" onChange="document.submitform.submit();">
<% for ( int i = 0 ; i < lineNums.length; i ++ ) {%>
<option value='<%=lineNums[i]%>' <%if ( lineNums[i] == lineCount ) {%> selected <%}%> ><%=lineNums[i]%></option>
<%}%>
</select> Before filter
<select name="log" onChange="document.submitform.submit();">
<% for ( int i = 0 ; i < logs.length ; i ++ ) {%>
<option <%if ( log.equals(logs[i]) ) {%> selected <%}%> value='<%=logs[i]%>'/><%=logValues[i]%><br/>
<%}%>
</select>
</td>
</tr>
</table>
</form>
<br/>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr class="portlet-section-header">
<td><fmt:message key="mvnforum.admin.common.line"/></td>
<td width="98%" align="center"><fmt:message key="mvnforum.admin.common.content"/></td>
</tr>
<tr>
<td colspan="2">
<%if ( MVNForumConfig.getEnablePortlet()) {
String[] lines = (String[])request.getAttribute("ContentLog");
%>
<%=log%>
<table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
<%
int index = 0;
for ( int i = 0 ; i < lines.length ; i ++ ) {
if (lines[i] == null ) break;// all last elements is null
if ( !log.equals("ALL") && lines[i].indexOf(log) < 0) continue; %>
<tr class="<%=MyUtil.getRowCSS(index)%>">
<td class="portlet-section-subheader"><%=index++ +1%></td>
<td nowrap>
<% if ((lines[i].indexOf("WARN") >= 0 ) || (lines[i].indexOf("ERROR") >= 0) || (lines[i].indexOf("FATAL") >= 0)) {%>
<span class='warning'><pre><%=lines[i]%></pre></span>
<%} else {%>
<pre><%=lines[i]%></pre>
<%}%>
</td>
</tr>
<%}//for
%>
</table>
<%} else {
String logframe = "logframe?filename" + fileName + "&linecount=" + lineCount + "&log=" + log;%>
<iframe src="<%=urlResolver.encodeURL(request, response, logframe)%>" align="center"
frameborder="0" height="400" width="100%" marginheight="0" marginwidth="0" scrolling="auto"></iframe>
<%}%>
</td>
</tr>
</table>
<br/>
<br/>
</fmt:bundle>
<%@ include file="footer.jsp"%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -