Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Add ingest log hooks (#21758)

Jin Hai4f27eff3f004
diff --git a/internal/common/model.go b/internal/common/model.go
index 7cf4f7d627..590f0ec241 100644
--- a/internal/common/model.go
+++ b/internal/common/model.go
@@ -86,3 +86,16 @@ func ParseCompositeModelName(compositeName string) (modelName, instanceName, pro
n := len(parts)
return strings.Join(parts[:n-2], "@"), parts[n-2], parts[n-1], nil
}
+
+type IngestLog struct {
+ EventTime time.Time `json:"event_time"`
+ UserID string `json:"user_id"`
+ UserName string `json:"user_name"`
+ Worker string `json:"worker"`
+ TaskID string `json:"task_id"`
+ Filename string `json:"filename"`
+ Code int `json:"code"`
+ Error error `json:"error"`
+ DurationMS int64 `json:"duration_ms"`
+ Operation map[string]any `json:"operation"`
+}
diff --git a/internal/common/stub.go b/internal/common/stub.go
index 0dacb0b53b..70a9243130 100644
--- a/internal/common/stub.go
+++ b/internal/common/stub.go
@@ -43,6 +43,6 @@ func InitIngestLog(logType string, file FileOutput, serviceName string) error {
return nil
}
-func IngestLog(fields ...zap.Field) {
+func LogIngest(fields ...zap.Field) {
}