View Logs
Warning
A non-debug build of ZLS will not report debug logs (by default) and stack traces when ZLS crashes.
It is recommended to building from source without -Doptimize
to include more verbose log messages.
zls.log
Note
This feature has been added in ZLS 0.14.0-dev.50+3354fdcb
.
Run zls env
and then look for the log_file
property:
{
"version": "0.14.0-dev.50+3354fdcb",
"global_cache_dir": "/home/anon/.cache/zls",
"global_config_dir": "/etc/xdg",
"local_config_dir": "/home/anon/.config",
"config_file": null,
"log_file": "/home/anon/.cache/zls/zls.log"
}
The logs can then be found in /home/anon/.cache/zls/zls.log
. Please note that ZLS will not empty the file when restarting but always append logs instead. The log file will not contain stack traces when ZLS crashes. Use Editor logs when the stack trace should be included.
Use Editor logs
Code Editor | Instructions | Notes |
---|---|---|
Visual Studio Code | Bottom Panel -> Output -> Zig Language Server | requires the ziglang.vscode-zig extension |
Sublime Text | LSP: Toggle Log Panel |
requires the LSP package |
JetBrains IDE with ZigBrains | Start the editor through the terminal | |
Helix | Open the helix log file. [:log-open] |
|
Zed | debug: open language server logs |
|
nvim-lspconfig | :LspLog |
nvim-lspconfig Troubleshooting |
NeoVim/Vim with CoC | :CocCommand workspace.showOutput |
CoC Debug language server |
Emacs with LSP-Mode | lsp-workspace-show-log |
LSP Mode Troubleshooting |
Emacs with Eglot | M-x eglot-stderr-buffer |
Troubleshooting Eglot |
Kate | Bottom Sidebar -> Output |
If your code editor or extension is not included in the above table, feel free to open an issue about it or edit this page directly.