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
LogInputStream
which will look at the chosen file as a logfile. -
Initialize a new
LogTableForm
that is made for displayingLogInputStreams
. -
Set the
LogTableForm
to theFormSheet
of theSalesPoint
by 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 |