invantive documentationpart of invantive cloud
Invantive Support ForumsLog In / Sign Up

Trace Files

The Trace panel shows the messages of a run as a table, which is what "what is it doing now" needs. A trace file holds the same messages on disk, which is what "what did it do last Tuesday at four" needs, and what a question sent to Invantive Support is best accompanied by.

Switching It On

From release 27.0 tracing to a file is switched on in the pane "Trace" of the window "Preferences", with the boxes "Trace Active" and "Trace to File Active"; the change is in effect at once and lasts until the product closes. The statement Set Trace does the same from a script and the options /trace, /tracetofile and /tracefolder do it from the start of the product. All of them are described in Trace Settings.

Up to and including release 26.0, and at every start of a later release, the environment the application was started in decides, through the environment variables INVANTIVE_TRACE_ACTIVE and INVANTIVE_TRACE_TO_FILE. The folder the trace files are written to is the one of INVANTIVE_TRACE_FOLDER, and without it INVANTIVE_CONFIGURATION_TRACE_FOLDER, which defaults to Trace under the configuration folder. They are documented under Trace Settings and Folders.

Switching the panel on does not switch the file on, and the other way round: the messages exist either way, and the two decide separately whether they are shown and whether they are written.

What Is In It

One JSON object per line, one line per message, with everything the panel shows in its columns and more: the moment in UTC, the level, the message code, the text, the duration and the quantity, the driver, the table, the partition, the thread, and the identifications the platform gave the request.

That shape is deliberate. A file of a hundred thousand messages is read by a program, not by a person, and one object per line is what lets a program read it without holding the whole file: select * from read_file_text@os(...) reaches it from a statement, and so does any other tool which reads NDJSON.

What to Watch

  • A trace of a long run is large. It is written for as long as the variable says so, and a workstation which traces permanently fills its disk.
  • A trace holds the statements which were executed and the values which were bound, so it can hold personal data or the data of a customer. It is treated as the data it traces: not mailed unencrypted, not left on a shared drive, and removed once the question is answered.
  • The trace of a run which failed is worth keeping before the product is restarted, since the next run writes its own.

Release Notes