Skip to content

feat: Refactor the log library of milvus, support scoped context logging#14

Open
chyezh wants to merge 1 commit intomilvus-io:mainfrom
chyezh:feat_mlog
Open

feat: Refactor the log library of milvus, support scoped context logging#14
chyezh wants to merge 1 commit intomilvus-io:mainfrom
chyezh:feat_mlog

Conversation

@chyezh
Copy link

@chyezh chyezh commented Feb 6, 2026

issue: milvus-io/milvus#35917

Summary

This PR implements the mlog package - a context-aware logging library built on
https://github.com/uber-go/zap, designed specifically for Milvus distributed systems.

Key Features

Mandatory Context Passing - All logging operations require a context, ensuring request traceability
Zero-Overhead Abstraction - Uses type aliases to avoid wrapper overhead, performance comparable to
direct zap usage
Automatic Field Accumulation - Context fields automatically accumulate through the call chain, child
contexts inherit parent fields
Cross-Service Propagation - Supports propagating key fields via gRPC metadata for distributed tracing
Lazy Encoding - Uses WithLazy for deferred field encoding, avoiding encoding overhead when log level
is disabled
Component-Level Logger - Provides optimized Logger type that selects the logger with more pre-encoded
fields to minimize runtime encoding

@sre-ci-robot sre-ci-robot requested review from czs007 and sunby February 6, 2026 03:48
@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: chyezh
To complete the pull request process, please assign yanliang567 after the PR has been reviewed.
You can assign the PR to them by writing /assign @yanliang567 in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants