CAS 6


Script Runtime Logging

CAS Scripts can now automatically log their runtime status to a CSV file.

Enable logging

Go to System->File Option

Set the log file destination directory. Filename with be automatically generated with the current UTC timestamp.

Set logging type in the Active dropdown.

Type Description
None No logging
Always Log script execution in regular and batch mode.
Batch Only log script with CAS started in command line batch mode.

Log filename and timestamp is controlled via the Timezone option.

Type Description
UTC UTC timestamp and appends a 'Z' to the end.
Local Timestamp using the system timezone.

Logging File Structure

The log file will be a comma delimited text file. Header includes fields in the order below:

Name Description
TIMESTAMP Time in ISO 8601 format. Trailing Z added if UTC timestamp. I.e. yyyy-MM-ddTHH:mm:ssZ format.
TYPE Log type: INFO, WARN and ERROR
FILE Full file path.
USER Windows username.
COMPUTER System name running the script.
PROCESSNAME CAS process name.
PROCESSID CAS session process id.
SCRIPTRUNTIMEID Unique script runtime id. Useful when same CAS sessions runs the same script multiple times.
BATCHSCRIPT Name of batch mode script.
SCRIPTNAME Current script name. Useful when scripts call subscripts.
SCRIPTLINE Script line on Error
MESSAGE Misc. info that can be added via user WriteLog* methods.

Sample Script Output

TIMESTAMP,TYPE,FILE,USER,COMPUTER,PROCESSNAME,PROCESSID,SCRIPTRUNTIMEID,BATCHSCRIPT,SCRIPTNAME,SCRIPTLINE,MESSAGE
2021-08-17T14:05:53Z,INFO,C:\repo\CAS-6.0\Files\TestData\Sample50 Test File.cas,johndoe,DESKTOP-FC6HT0G,dyalog,6624,16,,Calculate PV and Show Results,,START
2021-08-17T14:05:58Z,INFO,C:\repo\CAS-6.0\Files\TestData\Sample50 Test File.cas,johndoe,DESKTOP-FC6HT0G,dyalog,6624,16,,Calculate PV and Show Results,,SUCCESS
2021-08-17T14:13:01Z,INFO,C:\repo\CAS-6.0\Files\TestData\Sample50 Test File.cas,johndoe,DESKTOP-FC6HT0G,dyalog,6624,17,,Annex,,START
2021-08-17T14:13:04Z,INFO,C:\repo\CAS-6.0\Files\TestData\Sample50 Test File.cas,johndoe,DESKTOP-FC6HT0G,dyalog,6624,17,,Annex,,SUCCESS
2021-08-17T14:13:15Z,INFO,C:\repo\CAS-6.0\Files\TestData\Sample50 Test File.cas,johndoe,DESKTOP-FC6HT0G,dyalog,6624,18,,Portfolio Summary,,START
2021-08-17T14:13:32Z,INFO,C:\repo\CAS-6.0\Files\TestData\Sample50 Test File.cas,johndoe,DESKTOP-FC6HT0G,dyalog,6624,18,,Portfolio Summary,,SUCCESS
2021-08-17T14:26:20Z,INFO,C:\repo\CAS-6.0\Files\TestData\Sample50 Test File.cas,johndoe,DESKTOP-FC6HT0G,dyalog,2460,3,,Annex,,START
2021-08-17T14:26:20Z,INFO,C:\repo\CAS-6.0\Files\TestData\Sample50 Test File.cas,johndoe,DESKTOP-FC6HT0G,dyalog,2460,3,,Annex,,SUCCESS
2021-08-17T14:26:37Z,INFO,C:\repo\CAS-6.0\Files\TestData\Sample50 Test File.cas,johndoe,DESKTOP-FC6HT0G,dyalog,2460,4,,Annex,,START
2021-08-17T14:26:37Z,INFO,C:\repo\CAS-6.0\Files\TestData\Sample50 Test File.cas,johndoe,DESKTOP-FC6HT0G,dyalog,2460,4,,Annex,,SUCCESS
2021-08-17T14:26:56Z,INFO,C:\repo\CAS-6.0\Files\TestData\Sample50 Test File.cas,johndoe,DESKTOP-FC6HT0G,dyalog,2460,5,,Annex,,START
2021-08-17T14:27:21Z,INFO,C:\repo\CAS-6.0\Files\TestData\Sample50 Test File.cas,johndoe,DESKTOP-FC6HT0G,dyalog,2460,5,,Annex,,SUCCESS