1. How to run an Engine Trace from within X3 generally The Engine Tracing functionality changed significantly in 2021 R3 (Version 12 Patch 27). See the attached PDFs for more details on both the pre-V12 P27 and V12 P27+ methods of setting up Engine Tracing. See the attached PDF files for more information: 2. How to run an Engine Trace interactively from within a function You can manually enable and disable logging interactively following these steps: - From within a function go to Help, Diagnosis, Calculator
- In the Calculation: field enter Openlog ("TRA", 2) and press ENTER (You should see 0 in results field). Note: TRA represents the folder that the log file will be written to in the working folder. 2 represents the engine log level.
- Do the processing you wish to trace
- To stop the log, go back to the Calculator, type Closelog() and press ENTER (You should see 0 in results field)
- To retrieve the log file from within the application:
Go to Log reading (Reports, Reports, Log Reading) Find and Open up the log (it will start x3diary_...) Click Copy to download the file Alternatively, if you wish to retrieve it from the server then go to the TRA directory and look for the file starting "x3diary" 3. How to run/initiate an Engine Trace from within your 4GL code Within your code, you are going to enter something similar to: Local Integer RETTRACE
RETTRACE =openlog('TRA',5) **NOTE: Entering flag of "5" is just an example. Enter whatever flag is appropriate for your requirements
# The code you want to trace
RETTRACE=CloseLog() Note: TRA represents the folder that the log file will be written to. The value corresponds to the flag as defined in the Online help for Engine trace. |