Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Correctly for what? If you wanted to enable the group XML log element, then yes.
daiweisc

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.
martin

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
daiweisc

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.