HOWTO: Using LogWriter property to create a communication log

Enhanced logging capabilities are supported in most libraries.

Steps to enable logging in Rebex libraries:

  1. Add reference to the library and to Rebex.Common.dll.
  2. Add the following code after each call to the Rebex library main class constructor.
    (Where the "client" is an instance of a class such as: Sftp, Ftp, Smtp, Imap, Ssh, FileTransferClient, FileServer, WebClient, HttpRequestCreator, GraphClient, WebSocketClient, TlsSocket, TlsStream, Telnet, Scp, Pop3, Ews, SyslogClient, SyslogServer, ZipArchive.)

    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)