if (!adminSecurityCheck(request)) {
return mapping.findForward(BaseConstants.FWD_ADMIN_LOGIN);
}
SystemForm sysForm = (SystemForm)form;
int lineCount = 0;
try {
lineCount = Integer.parseInt(sysForm.getLineCount()); // 25, 50 100 200 400 800)
} catch (Exception e) {
if (lineCount == 0) {
lineCount = 50;
}
}
if (lineCount > 5000) {
lineCount = 5000;
}
if (sysForm.getLogType() == null || sysForm.getLogType().length() == 0) {
sysForm.setLogType("ALL");
}
File logFile = new File(getSysProp().getValue("LOGFILE.FILEPATH") + sysForm.getLogFileName());
sysForm.setLineCount(String.valueOf(lineCount)) ;
String[] contentLog = FileUtil.getLastLines(logFile, lineCount, sysForm.getLogType());
String humanSize = FileUtil.getHumanSize(logFile.length());
sysForm.setLogFileSize(String.valueOf(logFile.length()));
sysForm.setLogFileHumanSize(humanSize);
setSessionObject(request, BaseConstants.LOG_CONTENT, contentLog);
return mapping.findForward(BaseConstants.FWD_SUCCESS);
}