[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2319
  • Last Modified:

How to use idLogevent [indy ver 10.0.76]

hi all
do any one knows how to use idLogEvent or idLogFile or idLogDebug [indy ver 10.0.76 ].
i'm using delphi 7.
thanks
0
mirghani
Asked:
mirghani
  • 2
1 Solution
 
Mohammed NasmanSoftware DeveloperCommented:
Hi

I have indy 9 with Delphi 7, but it should work in the same way with Indy 10

procedure TForm1.Button1Click(Sender: TObject);
begin
  idLogFile1.Filename := 'c:\indy.log';
  idLogFile1.Active := True;

  Idhttp1.Intercept := idLogFile1;

  idHttp1.Get('http://www.google.com');
end;

Regards,
mohammed
0
 
Mohammed NasmanSoftware DeveloperCommented:
Hi again

  I just notices it changed in indy 10, I tried this sample with D2005 and indy 10, you have to use TIdIOHandlerStack to link the IdHttp with IdLogFile

Here's the sample again for Indy 10

procedure TForm1.Button1Click(Sender: TObject);
begin
  idLogFile1.Filename := 'c:\indy10.log';
  idLogFile1.Active := True;

  IdIOHandlerStack1.Intercept :=idLogFile1;
  Idhttp1.IOHandler :=  IdIOHandlerStack1;

  idHttp1.Get('http://www.google.com');
end;

Regards,
Mohammed
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now