<table id="logTable" width="100%" cellspacing=0 cellpadding=2 border="1" style='table-layout:fixed' >
<%
InputStream is = null;
InputStreamReader isr = null;
BufferedReader ibr = null;
try {
String logFile = "/app/apache-tomcat/logs/catalina.out";
String tailCommand = "tail -f " + logFile;
Runtime runtime = Runtime.getRuntime();
Process process = runtime.exec(tailCommand);
is = process.getInputStream();
isr = new InputStreamReader(is);
ibr = new BufferedReader(isr, 8192*2);
String rLine="";
int lineNum = 0 ;
while ((rLine = ibr.readLine()) != null) {
%>
<tr>
<td width="50" valign=top ><%=(++lineNum)%></td>
<td ><%=rLine%></td>
</tr>
<%
}
}catch(Exception e ){
e.printStackTrace();
} finally {
if( ibr != null ) ibr.close();
if( isr != null ) isr.close();
if( is != null ) is.close();
}
%>
</table>