CAS Scripts can now automatically log their runtime status to a CSV file.
The log file is append to by each script execution.
Log files are automatically created with a UTC date stamp.
cas_script_log_20210817.csv
Multiple CAS sessions can use the same file.
Logging is set individually for each CAS file.
Log directory path must be set or the CAS temp directory will be used. CAS Temp directory is cleared with each session startup and end.
CAS may not be able to append log data to a file currently open in Excel if Excel puts an exclusive hold on the file.
Log files are written in UTF8 encoding.
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. |
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. |
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