Using the Log Service
From InterBase
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
TIBLogService
component on a Delphi application. - Drop
Button
andMemo
components on the same application. - Attach to the service manager as described in Attaching to a Service Manager.
- 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;