To enable the session and debugging logging, set
https://beta.winscp.net/eng/docs/library_session
Session.SessionLogPath and Session.DebugLogPath:
https://beta.winscp.net/eng/docs/library_session