nvs debug
nvs debug reads the debug records of your requests and runs into one database.
With [debug] store = true in nvs.toml, Novis writes a record of each request, nvs run and nvs test. The records go to files in debug/spool in the data folder. Novis finishes a file before nvs debug reads it. nvs debug saves its records in debug/index.sqlite and deletes the file. Then it waits for new files. When nvs debug starts, it reads the files that were written while it was not running.
In development mode, nvs serve starts nvs debug when store is on, and stops it with the server. On a production host, you start nvs debug yourself.
--once reads the files that are ready, deletes old records, and exits. --tail <file> reads a log file too. nvs debug reads the lines that are in the file, and each line that is added later. Set [log] format = "json" for that log. nvs debug never changes the file.
Only one nvs debug runs for a data folder. A second one prints an error and exits with status 1.
Examples
Print the options of nvs debug
nvs debug --helpRun the debug service: read recorded requests into one SQLite database, and serve the debug viewer....Options: --once Read the files that are ready once, then exit
--tail <FILE> Also read the log file at this path, and every line that is added to it later. The file must use the `json` log format. `nvs debug` never changes the file. You can give this option more than once...Changelog
| Version | Change |
|---|---|
0.0.6 | The debug viewer has three new pages. Outbound lists the calls your code made to other servers, and Code shows which lines ran and which lines copied a value, over all requests. Schedule shows each [[schedule]] job with its next run, and each queue with its pending, failed and dead-letter jobs. |
0.0.6 | The Debug page of the debug viewer lists traces beside dumps and profiles. Each profile and trace shows the file and line that started it, and By site groups every kind by its line. The number beside Debug counts every record since you opened the viewer. |
0.0.6 | The debug viewer shows the server's own log lines, such as its start, a reload or a compile error, on the Logs page. The Server filter shows only these lines. You do not need nvs debug --tail for them. |
0.0.6 | When a request does not pass one of the server's checks, the debug viewer shows the cause. An example is a body that is too large. The Refused filter of the request list and the search term refused:<cause> find these requests. |
0.0.6 | A run's page in the debug viewer has a Tests tab with each test of nvs test and its result. Its Output tab shows what the run printed. It also lists the run's profiles, and has a Coverage tab. |
0.0.6 | The debug viewer's timeline shows calls to LDAP, IMAP, file transfer servers and Redis, database transactions and schema applies. Each call shows the server it reached, and a failed call shows its error's class. Search finds a call with kind: and target:. |
0.0.6 | A request that opened a WebSocket or an event stream shows the connection in the debug viewer. You see how long it was open, the frames each way and why it closed. In development, the first 32 frames each way are shown. |
0.0.6 | The Errors page of the debug viewer has a Faults tab. It lists each request or run that a panic or a limit stopped, and each TLS connection that failed, with its cause and its message. |
0.0.6 | A production server records no dumped value, only its file and line and the type and size of each value. In development, a recorded JSON or form field named password, secret, token or api_key is replaced with [redacted]. The Settings page of the debug viewer lists the newest 50 sign-ins. |
