[PR #14019] logutil: add JSON logging format support via OLLAMA_LOG_FORMAT #76766

Open
opened 2026-05-05 09:25:56 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14019
Author: @BOPOHA
Created: 2/1/2026
Status: 🔄 Open

Base: mainHead: main


📝 Commits (1)

  • 3a3e35f logutil: add JSON logging format support via OLLAMA_LOG_FORMAT

📊 Changes

1 file changed (+11 additions, -2 deletions)

View changed files

📝 logutil/logutil.go (+11 -2)

📄 Description

Add configurable log output format to support both human-readable text and machine-parsable JSON formats. When OLLAMA_LOG_FORMAT=json is set, the logger uses slog.NewJSONHandler instead of the default text handler. Maintains backward compatibility with existing text format as default and preserves all existing handler options for both formats.

fixes #14018


🔄 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/14019 **Author:** [@BOPOHA](https://github.com/BOPOHA) **Created:** 2/1/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`3a3e35f`](https://github.com/ollama/ollama/commit/3a3e35fdd52eb3b37dfde4cd27daa048a33ee2e8) logutil: add JSON logging format support via OLLAMA_LOG_FORMAT ### 📊 Changes **1 file changed** (+11 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `logutil/logutil.go` (+11 -2) </details> ### 📄 Description Add configurable log output format to support both human-readable text and machine-parsable JSON formats. When OLLAMA_LOG_FORMAT=json is set, the logger uses slog.NewJSONHandler instead of the default text handler. Maintains backward compatibility with existing text format as default and preserves all existing handler options for both formats. fixes #14018 --- <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-05-05 09:25:56 -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#76766