rust-lang / rust-lang/log

structured logging: Add a list of fields to Metadata

Open
#685 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.5k
Forks
289
Avg merge
55m
Merged PRs (30d)
1

Description

It would be handy to have a list of fields, and some basic metadata about them (name, formatting options, etc) available in Metadata when structured logging is being used.

My desired use case here is something that is currently possible with tracing: In OpenVMM we have implemented a 'tagging' system for events, where by including a field with a known name and a value of tracing::Empty we can filter out the logging of events based on the presence or absence of these tags. See https://github.com/microsoft/openvmm/blob/main/vm/cvm_tracing/src/lib.rs if you're curious as to how this all works. And since tracing::Empty doesn't generate any output these tags are completely transparent to the final produced logs. I'm hoping Value::null() could be used for the same in log?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Metadata and the structured-logging path, then compare the tagging approach in OpenVMM's vm/cvm_tracing/src/lib.rs. Define what field names and formatting metadata must be exposed, and verify whether Value::null() can represent transparent tag fields without changing produced logs.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.