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

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. You can configure which logs should be included with the --log-file flag. A debug build of ZLS will include all logs by default.

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 EditorInstructionsNotes
Visual Studio CodeBottom Panel -> Output -> ZLS Language Serverrequires the ziglang.vscode-zig extension
Sublime TextLSP: Toggle Log Panelrequires the LSP package
JetBrains IDE with ZigBrainsStart the editor through the terminal
HelixOpen the helix log file. [:log-open]
Zeddebug: open language server logs
nvim-lspconfig:LspLognvim-lspconfig Troubleshooting
NeoVim/Vim with CoC:CocCommand workspace.showOutputCoC Debug language server
Emacs with LSP-Modelsp-workspace-show-logLSP Mode Troubleshooting
Emacs with EglotM-x eglot-stderr-bufferTroubleshooting Eglot
KateBottom 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.