Re: How to use IdLog Components

Giganews Newsgroups
Subject: Re: How to use IdLog Components
Posted by:  Remy Lebeau (TeamB) (gambit47.no.spam@no.spam.yahoo.com)
Date: Wed, 17 Mar 2004

"Stefan Bartos" <s…@gmxpro.de> wrote in message
news:EAC59E42F395E240s…@gmxpro.de...

> I'm trying to use the IdLogxxx - Components (Indy9)  to catch
> some information running between a Client (MS OE) and Server
> (IdSMTPServer). But I can't get them to work. I've put some
> code in the event routines of the IdLog-Components, I've
> activated them, but nothing is happen.

Did you actually attach the TIdLog... component to the connection's
Intercept property?  They won't do anything otherwise.

Since you are making a server, you will have to attach the component in the
server's OnConnect event, ie:

    procedure TForm1.IdSMTPServer1Connect(AThread: TIdPeerThread);
    var
        Log: TIdLogFile;
    begin
        Log := TIdLogFile.Create(AThread.Connection);
        Log.FileName := 'the desired filename';
        AThread.Connection.Intercept := Log;
    end;

Gambit

Replies

In response to

How to use IdLog Components posted by Stefan Bartos on Wed, 17 Mar 2004