Skip to content

[featrue] add trace log for ai-resource-version #14833

Description

@shiyiyue1102

Describe the bug
[Feature Request] Add a dedicated audit trace log file ai_resource_trace.log for AI resource lifecycle operations in Nacos version 3.2.1.2026.03.30.
(功能请求:为 Nacos 3.2.1.2026.03.30 版本新增专用审计追踪日志文件 ai_resource_trace.log,用于记录 AI 资源版本的全生命周期操作。)

Expected behavior
The system should automatically record structured trace entries into ai_resource_trace.log whenever an operator interacts with AI resources/versions. Each log entry must clearly capture:

  • Who: Operator ID / Username
  • When: Timestamp (ISO 8601 format)
  • Which Resource: Resource ID/Name & Target Version
  • What Operation: Action type and execution result
    Supported operations should include, but not be limited to:
    CREATE_DRAFT, UPLOAD_SKILL, REVIEW_REJECTED, REVIEW_APPROVED, REVIEW_FORCE_SKIP, SET_TAG, REMOVE_TAG, OFFLINE_VERSION, DELETE_VERSION, etc.
    (系统应在操作 AI 资源/版本时自动向 ai_resource_trace.log 写入结构化日志。每条日志需清晰记录:操作人、时间戳、资源标识及版本、操作类型与结果。涵盖的操作包括:创建草稿、上传 Skill、审核不通过、审核通过、审核强制跳过、设置标签、移除标签、下线资源版本、删除版本等。)

Actually behavior
Currently, these operations are either logged in the generic application log (nacos.log), scattered across different modules, or lack a unified, structured format. There is no dedicated, easily queryable audit trail specifically for AI resource version operations, making compliance auditing, security tracing, and troubleshooting inefficient.
(目前这些操作要么记录在通用的 nacos.log 中,要么分散在不同模块,缺乏统一的结构化格式。没有专门针对 AI 资源版本操作的审计追踪日志,导致合规审计、安全溯源和问题排查效率低下。)

How to Reproduce
Steps to demonstrate the current limitation:

  1. Log in to Nacos console or call API to perform AI resource operations (e.g., create draft, upload skill, approve/reject review, delete version).
  2. Check the default log directory (logs/).
  3. Observe that no dedicated ai_resource_trace.log exists, and relevant operation traces are mixed with other system logs, making it difficult to filter by operator, resource, or operation type.
    (复现当前局限性的步骤:1. 执行 AI 资源操作;2. 检查日志目录;3. 发现无专用日志文件,操作记录混杂在系统日志中,难以按操作人、资源或操作类型过滤。)

Desktop (please complete the following information):

  • OS: Any (Linux/Windows/macOS)
  • Version: nacos-server 3.2.1.2026.03.30
  • Module: AI Resource Management / Config & Audit
  • SDK: N/A (Server-side logging feature)

Additional context

  • Suggested Log Format: JSON or KV pair for easy parsing by ELK/Loki. Example:
    {"timestamp":"2026-03-30T10:15:30Z","operator":"admin_01","resource_id":"res-ai-001","version":"v1.2.0","operation":"REVIEW_APPROVED","status":"SUCCESS","ip":"192.168.1.100"}
  • Log Rotation: Recommend standard size/time-based rotation (e.g., ai_resource_trace.log.2026-03-30) to prevent disk overflow.
  • Compliance: This feature is critical for enterprise security audits and operational traceability.
  • Implementation Hint: Can leverage existing AOP/interceptor mechanisms in Nacos to capture controller/service layer calls and route them to a dedicated RollingFileAppender with a custom logger name (e.g., AI_RESOURCE_TRACE).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions