Change log level with command line parameter?

Advertisement

g24ftp
Joined:
Posts:
17

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)

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

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

Reply with quote

Advertisement

You can post new topics in this forum