How to create a log of communication between component and server?

+1 vote
asked Jan 12, 2010 by Rebex KB (8,380 points)
edited Jun 26, 2013

Is it possible to create a detailed log of communication between client (component) and the server? It would help us detect problem sources. The log should include:

  • Commands sent by client
  • Responses received from server
  • Description of activities

1 Answer

+1 vote
answered Jan 12, 2010 by Rebex KB (8,380 points)
edited 5 days ago by Lukas Pokorny
 
Best answer

Enhanced logging capabilities are supported in all session-based components (=nearly all Rebex components except Rebex Time).

Steps to enable logging in Rebex components:

  1. Add reference to Rebex.Common.dll and Rebex.Networking.dll
  2. Add following code after each call to the Rebex component constructor. The "client" is an instance of Ftp, Sftp, Scp, Smtp, Imap, Pop3, Ssh or Telnet class.

C#

// change the log path if needed
client.LogWriter = new Rebex.FileLogWriter(
    @"c:\temp\log.txt", 
    Rebex.LogLevel.Debug); 

VB.NET

' change the log path if needed
client.LogWriter = new Rebex.FileLogWriter( _
    "c:\temp\log.txt", _
    Rebex.LogLevel.Debug) 
commented 5 days ago by nitinjain (100 points)
don't think, this is true. I am using Latest version 5.0.7840.0. I take the reference of Rebex.po3 and Rebex.Comon. It asks me to add reference of Rebex.Networking to add Log Write
mailClient.LogWriter = New Rebex.FileLogWriter
commented 5 days ago by Lukas Pokorny (123,810 points)
Thanks for letting us know, I fixed the answer.
...