Save logs of workflow in scheduled mode

Hello my friends.
I am a workflow that scheduled with bat file.
Bat file has this code:
“C:\Program Files\KNIME\knime.exe” --launcher.suppressErrors -nosave -reset -nosplash -consoleLog -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir=“C:\Users\davood\knime-workspace\test”

It works correctly.
But I want to save everything was happened as log.

Please help me.
Tank you.

@Davood you can add a log option like this to your .bat file. Also you could opt to enable logs per workflow in knime.

REM %USERNAME% is an automatic Windows variable
REM you must adapt the paths to your system and KNIME version (obviously)
set KNIME_PATH=C:\Users\%USERNAME%\software\knime_4.7.0\knime.exe

REM Set the path to your workflow directory (the workflow you want to run)
set WORKFLOW_DIR=C:\Users\%USERNAME%\knime-workspace\KNIME_Batch\KNIME_Simple_Batch_Windows

REM Set a string variable to pass to the workflow (a variable to be used in the workflow)
REM you have to define them as workflow variable in WF
set STRING_VAR_NAME=var_data_path
set STRING_VAR_VALUE=C:\Users\%USERNAME%\knime-workspace\KNIME_Batch\data\

REM Set the path for the log file
set LOG_FILE=C:\Users\%USERNAME%\knime-workspace\KNIME_Batch\knime_batch_log.txt

REM Run KNIME in batch mode with the specified workflow and string variable
"%KNIME_PATH%" -reset -nosave -nosplash -consoleLog -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir="%WORKFLOW_DIR%" ^
-workflow.variable=%STRING_VAR_NAME%,%STRING_VAR_VALUE%,String > "%LOG_FILE%" 2>&1

2 Likes

Thank you very much. :revolving_hearts:

I opted to “enable per workflow logs” and it works OK and it is enough.
I test your configuration of .bat file later if it needed.

24c4900104c92453991b8160096525d34d52392a

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.