in reply to To Log FTP Transfers.

Hello hark-Tooth, and welcome to the Monastery!

First, you need a logging mechanism. You could roll your own, but there are many options available on : Log::Minimal, Log::Lite, Log::Log4perl, etc.

Next, you need a way to call your logging mechanism on each transfer operation (assuming you need this level of detail in your log). Fortunately, Net::SFTP provides callback hooks for its get and put methods, so you just need to write a small callback subroutine which invokes the logger, and pass in a reference to this sub when you invoke the get or put method.

As the number of file transfers is “huge,” you will want to configure the logger to rotate the log file fairly regularly.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: To Log FTP Transfers.
by hark-Tooth (Initiate) on May 08, 2014 at 07:11 UTC
    Hi Athanasius, Can you please give me some sample code for "callbacks" which will invoke logger when get/put method is invoke.

      The Net::SFTP documentation already gives examples of the callbacks to monitor progress.

      This is not a code writing service. We will readily provide you with the appropriate documentation and support you with your problems, but you will have to do the learning and the work yourself.