[PR #10650] [MERGED] feat: add trace log level #39186

Closed
opened 2026-04-22 23:50:09 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/10650
Author: @mxyng
Created: 5/10/2025
Status: Merged
Merged: 5/12/2025
Merged by: @mxyng

Base: mainHead: mxyng/trace


📝 Commits (3)

📊 Changes

13 files changed (+141 additions, -114 deletions)

View changed files

📝 app/lifecycle/logging.go (+2 -20)
📝 discover/gpu.go (+1 -1)
📝 envconfig/config.go (+16 -3)
📝 envconfig/config_test.go (+33 -0)
📝 llm/server.go (+35 -24)
logutil/logutil.go (+29 -0)
📝 ml/backend/ggml/ggml.go (+2 -1)
📝 model/model.go (+2 -1)
📝 model/process_text.go (+4 -0)
📝 model/process_text_spm.go (+7 -2)
📝 runner/llamarunner/runner.go (+4 -20)
📝 runner/ollamarunner/runner.go (+4 -18)
📝 server/routes.go (+2 -24)

📄 Description

TRACE level outputs more information about the process. it's intended use is to trace debug generation including input encoding and output decoding.

This configuration is controlled by the existing OLLAMA_DEBUG environment variable. In addition to the current truthy values which enable DEBUG logging, integer value can now be used to finely control the log level.

  • OLLAMA_DEBUG= or OLLAMA_DEBUG=0 or OLLAMA_DEBUG=false: unset or empty or falsy values sets default INFO level
  • OLLAMA_DEBUG=1 or OLLAMA_DEBUG=true: set DEBUG level
  • OLLAMA_DEBUG=2: set TRACE level

Related #10635
Resolves #10613


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/10650 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 5/10/2025 **Status:** ✅ Merged **Merged:** 5/12/2025 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/trace` --- ### 📝 Commits (3) - [`31458f5`](https://github.com/ollama/ollama/commit/31458f548e2fceb1ac3ce893c720c0c871b0aef9) feat: add trace level - [`4888c3b`](https://github.com/ollama/ollama/commit/4888c3b7ea36547cbc97c1538d41711fe85437fd) add trace logs - [`a3f4c50`](https://github.com/ollama/ollama/commit/a3f4c5079b0b2fd51a91f7e7987f7b8505830f9f) add generate request ### 📊 Changes **13 files changed** (+141 additions, -114 deletions) <details> <summary>View changed files</summary> 📝 `app/lifecycle/logging.go` (+2 -20) 📝 `discover/gpu.go` (+1 -1) 📝 `envconfig/config.go` (+16 -3) 📝 `envconfig/config_test.go` (+33 -0) 📝 `llm/server.go` (+35 -24) ➕ `logutil/logutil.go` (+29 -0) 📝 `ml/backend/ggml/ggml.go` (+2 -1) 📝 `model/model.go` (+2 -1) 📝 `model/process_text.go` (+4 -0) 📝 `model/process_text_spm.go` (+7 -2) 📝 `runner/llamarunner/runner.go` (+4 -20) 📝 `runner/ollamarunner/runner.go` (+4 -18) 📝 `server/routes.go` (+2 -24) </details> ### 📄 Description `TRACE` level outputs more information about the process. it's intended use is to trace debug generation including input encoding and output decoding. This configuration is controlled by the existing `OLLAMA_DEBUG` environment variable. In addition to the current truthy values which enable `DEBUG` logging, integer value can now be used to finely control the log level. - `OLLAMA_DEBUG=` or `OLLAMA_DEBUG=0` or `OLLAMA_DEBUG=false`: unset or empty or falsy values sets default INFO level - `OLLAMA_DEBUG=1` or `OLLAMA_DEBUG=true`: set DEBUG level - `OLLAMA_DEBUG=2`: set TRACE level Related #10635 Resolves #10613 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-22 23:50:09 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#39186