Post a reply

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

Re: Change log level with command line parameter?

Edit 2023: First, if the log size started being larger suddenly, it's likely because you have increased the logging level in the GUI. And as your script is not isolated from the GUI configuration, it got affected. Use /ini=nul to isolate the script from GUI configuration (what will among other reset the logging to the default Normal level).
See https://winscp.net/eng/docs/scripting#configuration

Anyway, to explicitly set logging level on commandline, use /loglevel switch.
https://winscp.net/eng/docs/commandline#logging
g24ftp

Change log level with command line parameter?

Hello,

I have a problem with logging my file transfers.
I am using a batch-file where I execute the following script.
set WrkDir=C:\WinSCP
set BatchFile=%WrkDir%\Test.batch
set LogFile=%WrkDir%\Test.log
 
echo>%BatchFile% option echo on
echo>>%BatchFile% option batch abort
echo>>%BatchFile% option confirm off
echo>>%BatchFile% option reconnecttime off
echo>>%BatchFile% option transfer binary
echo>>%BatchFile% open User@123.123.123.123
echo>>%BatchFile% ls
echo>>%BatchFile% put Test.jpg
echo>>%BatchFile% exit
 
"C:\WinSCP\winscp.com" /script=%BatchFile% /log=%LogFile%

Some time ago the log-files started to get pretty big, like 700mb log-file for a 170mb file.
So I perhaps the default log-level has changed.

So is there a special parameter or command to change the log-level for a transfer, I could use in this line:
winscp.com /script=%BatchFile% /log=%LogFile%

I am using version 5.1.4, but I tested this scenario with the newest version, too (5.1.7)