mirror of
https://github.com/mudler/LocalAI.git
synced 2026-02-14 16:41:20 -05:00
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 <localai-bot@users.noreply.github.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user