From b10b85de52d2c78337eaeef7380820c1cb6b1a4d Mon Sep 17 00:00:00 2001 From: "LocalAI [bot]" <139863280+localai-bot@users.noreply.github.com> Date: Thu, 12 Feb 2026 16:24:46 +0100 Subject: [PATCH] chore: improve log levels verbosity (#8528) * chore: init for PR * feat: improve log verbosity per #8449 - demote /api/resources to DEBUG, elevate job events to INFO --------- Co-authored-by: localai-bot --- core/http/app.go | 6 +++--- core/services/agent_jobs.go | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/http/app.go b/core/http/app.go index 88cd3ffa8..97f465be0 100644 --- a/core/http/app.go +++ b/core/http/app.go @@ -109,10 +109,10 @@ func API(application *application.Application) (*echo.Echo, error) { res := c.Response() err := next(c) - // Fix for #7989: Reduce log verbosity of Web UI polling - // If the path is /api/operations and the request was successful (200), + // Fix for #7989: Reduce log verbosity of Web UI polling and resources API + // If the path is /api/operations or /api/resources and the request was successful (200), // we log it at DEBUG level (hidden by default) instead of INFO. - if req.URL.Path == "/api/operations" && res.Status == 200 { + if (req.URL.Path == "/api/operations" || req.URL.Path == "/api/resources") && res.Status == 200 { xlog.Debug("HTTP request", "method", req.Method, "path", req.URL.Path, "status", res.Status) } else { xlog.Info("HTTP request", "method", req.Method, "path", req.URL.Path, "status", res.Status) diff --git a/core/services/agent_jobs.go b/core/services/agent_jobs.go index 0f702f6c6..2d36fcf65 100644 --- a/core/services/agent_jobs.go +++ b/core/services/agent_jobs.go @@ -676,6 +676,7 @@ func (s *AgentJobService) executeJobInternal(job schema.Job, task schema.Task, c job.Status = schema.JobStatusRunning job.StartedAt = &now s.jobs.Set(job.ID, job) + xlog.Info("Job started", "job_id", job.ID, "task_id", job.TaskID) // Load model config modelConfig, err := s.configLoader.LoadModelConfigFileByNameDefaultOptions(task.Model, s.appConfig) @@ -980,6 +981,7 @@ func (s *AgentJobService) executeJobInternal(job schema.Job, task schema.Task, c job.Result = f.LastMessage().Content job.CompletedAt = &completedAt s.jobs.Set(job.ID, job) + xlog.Info("Job completed", "job_id", job.ID, "status", job.Status) // Save to file (async) go func() {