Using the Log Service

From InterBase
Jump to: navigation, search

Go Up to Working with InterBase Services


Use the TIBLogService to retrieve the InterBase.log file, if it exists, from the server. If the log file does not exist, an error is returned.

To use the log service:

  1. Drop a TIBLogService component on a Delphi application.
  2. Drop Button and Memo components on the same application.
  3. Attach to the service manager as described in Attaching to a Service Manager.
  4. Start the log service using the ServiceStart method.

The following example displays the contents of the InterBase.log file. With a click of the button, the log file is displayed until the end of the file is reached.

procedure TForm1.Button1Click(Sender: TObject);
begin
with IBLogService1 do
begin
ServerName := 'Poulet';
LoginPrompt := False;
Params.Add('user_name=sysdba');
Params.Add('password=masterkey');
Active := True;
ServiceStart;
try
While not Eof do
Memo1.Lines.Add(GetNextLine);
finally
Active := False;
end;
end;
end;