HowTo's - Display: LogFile Management

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:

ToDo:

  1. Instantiate a FileInputStream.
  2. Lead that stream into the LogInputStream which will look at the chosen file as a logfile.
  3. Initialize a new LogTableForm that is made for displaying LogInputStreams.
  4. Set the LogTableForm to the FormSheet of the SalesPoint by calling setFormSheet(SaleProcess sp, FormSheet fs).
  5. 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:


previous Display: MenuSheetDisplay: User Management next


Valid HTML 4.01!