I am using a bat file to call WinScp to connect SFTP through which I transfer a text file to my local computer so if my task fails it should throw an exception on that so I am searching that if I can get that log or where should I write my script to get the email regarding that
Log of what? Are you using WinSCP? How are you using WinSCP? GUI, or some scripting? Do you want client-side or server-side log?
I just want to know if I can get a log for a fail file transfer from my server to SFTP. If a file was not able to transfer from server to FTP then it creates a log? I want to know from how I get that log