Capturing debug output

Top  Previous  Next

All data exchanged between the SSH client and server may be captured by enabling debugging. To enable/disable debugging set the SshSession.Debug property. By default debugging is disabled. When debugging is enabled all debugging output is directed to the console. You may redirect this output to another stream using the SshSession.DebugStream property.

 

 

Example

 

[C#]

 

// create new SshSession instance

SshSession session = new SshSession(hostname,username,password);

 

// enable debugging

session.Debug = true;                        

 

// send debugging information to a file

StreamWriter writer = new StreamWriter("c:\\tmp\\debug.txt");

session.DebugStream = writer;

 

[VB]

 

' create new SshSession instance

Dim session As SshSession = New SshSession(hostname, username, password)

 

' enable debugging

session.Debug = True

 

' send debugging information to a file

Dim writer As StreamWriter = New StreamWriter("c:\tmp\debug.txt")

session.DebugStream = writer