HOWTO: Using LogWriter property to create a communication log
Enhanced logging capabilities are supported in all session-based libraries (=nearly all Rebex libraries except Rebex Time).
Steps to enable logging in Rebex libraries
-
Add reference to
Rebex.Common.dll
. -
Add following code after each call to the Rebex library main class constructor. The "client" is an instance of Ftp, Sftp, Scp, Smtp, Imap, Pop3, Ssh, Telnet, WebClient or HttpRequestCreator 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)