The log file in WinSCP is very large after running, how can I reduce it?

Advertisement

daiweisc
Joined:
Posts:
2
Location:
hlj

The log file in WinSCP is very large after running, how can I reduce it?

My bat code is below:
del /f /s /q example.log
"C:\Program Files (x86)\WinSCP\winscp.com" /script=SyncRemoteScript.txt /log=example.log
pause
The log file in WinSCP is very large, about 22Mb after running, please help me get the small log file, hope not greater than 1Mb.
The log file should include error information, the number of uploaded files, etc.

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,034
Location:
Prague, Czechia

Re: The log file in Winscp is very large after running, how can I reduce it?

You didn't tell us much about the log. So we cannot know if the log is large because WinSCP does many operations or because you have enabled debug logging inadvertently.

Use /loglevel to change the log level.
https://winscp.net/eng/docs/commandline#logging

You should isolate your script from GUI configuration, so that logging setting changes in the GUI do not impact your script:
https://winscp.net/eng/docs/scripting#configuration

You might also consider using XML logging:
https://winscp.net/eng/docs/logging_xml

Reply with quote

daiweisc
Joined:
Posts:
2
Location:
hlj

The code change below:
del /f /s /q example.log
"C:\Program Files (x86)\WinSCP\winscp.com" /script=SyncToRemote.txt /xmllog=example.log /xmlgroups
pause
the log file reduce to 428kb. Is /xmlgroups set correctly?
Thanks reply.

Reply with quote E-mail

Advertisement

You can post new topics in this forum