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

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
JanekRoos
Posts: 11
Joined: Thu 07 May 2020 08:51

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

Post by JanekRoos » Tue 12 May 2020 11:13

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

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

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

Post by ViktorV » Thu 14 May 2020 11:56

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;

Post Reply