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
How to make log file in C:\Users\Janek\Documents\Devart\SecureBridge for Delphi 6\Demos\SFTPClient ?
Re: How to make log file in C:\Users\Janek\Documents\Devart\SecureBridge for Delphi 6\Demos\SFTPClient ?
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:
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;