Skip to content

structured logging: Add a list of fields to Metadata #685

Description

@smalis-msft

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?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions