Display log file content
Description:
In a logfile you can log any event of your framework-application, wether it is a commited process or a rollback, a User
logging on, a wrong password entered, just anything.
To display a logfile in a FormSheet, use the LogTableForm, which is a subclass of FormSheet
and contains a JLogTable. Remember that the information in that table is being read at creation time and won't be
updated when the logfile changes.
Used classes:
Related topics:
- none
ToDo:
-
Instantiate a
FileInputStream. -
Lead that stream into the
LogInputStreamwhich will look at the chosen file as a logfile. -
Initialize a new
LogTableFormthat is made for displayingLogInputStreams. -
Set the
LogTableFormto theFormSheetof theSalesPointby callingsetFormSheet(SaleProcess sp, FormSheet fs). - Catch the relevant exceptions.
Example Source Code:
try
{
1
FileInputStream fileStream = new FileInputStream("machine.log");
2
LogInputStream logStream = new LogInputStream(fileStream);
3
LogTableForm logForm = new LogTableForm("View log file", logStream);
4
setFormSheet(null, logForm);
}
5
catch(FileNotFoundException fileEx)
{
// exception handling here
}
catch(IOException ioEx)
{
// exception handling here
}
catch(InterruptedException interruptEx)
{
// exception handling here
}
Back to:
Display: MenuSheet | Display: User Management ![]() |
Display: MenuSheet