Using the Log Service
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:
- Drop a
TIBLogServicecomponent on a Delphi application. - Drop
ButtonandMemocomponents on the same application. - Attach to the service manager as described in Attaching to a Service Manager.
- Start the log service using the
ServiceStartmethod.
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;