Page 1 of 1

How to make log file in C:\Users\Janek\Documents\Devart\SecureBridge for Delphi 6\Demos\SFTPClient ?

Posted: Tue 12 May 2020 11:13
by JanekRoos
Hello!

I run SecureBridge SFTP Client under the Windows 7 Delphi 6.
How to make log file in C:\Users\Janek\Documents\Devart\SecureBridge for Delphi 6\Demos\SFTPClient ?
I mean that maybe in the future I need to make log file to send it to you.

Kind Regards,
Janek Parviste from Estonia

Re: How to make log file in C:\Users\Janek\Documents\Devart\SecureBridge for Delphi 6\Demos\SFTPClient ?

Posted: Thu 14 May 2020 11:56
by ViktorV
The TScSSHClient and TScSFTPClient components don't provide a separate method for logging.
To accomplish your task, you may do the following:
- use the event handlers of the TScSSHClient and TScSFTPClient components to log the necessary operations;
- use the event handler TScSFTPClient.OnError to handle errors of the EScSFTPError class;
- use the exception-handling blocks to handle all errors, i.e. put all TScSFTPClient and TScSFTPClient method calls in the exception-handling blocks and do logging in the except section. For example:

Code: Select all

try
  ScSSHClient.Connect;
except
  on E: Exception do
    ... error logging
end;