The [[Invantive Query Tool/Trace|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
Tracing to a file is decided by the environment the application was started in rather than by a button, through the environment variable `INVANTIVE_TRACE_ACTIVE`; the folder it writes to is `INVANTIVE_CONFIGURATION_TRACE_FOLDER`, which defaults to `Trace` under the configuration folder. Both are documented under [[Environment Variables]] 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.