Skip to content

Structured logging doesn't seem to work #540

@svanharmelen

Description

@svanharmelen

Hi 👋🏻 I'm trying write structured logs, but somehow the key/values seem to be ignored...

I have this in my Cargo.toml:

[dependencies]
env_logger = "0.10"
log = { version = "0.4.17", features = ["kv_unstable"] }

And this is main.rs:

use log::info;

fn main() {
    env_logger::builder()
        .filter_level(log::LevelFilter::Info)
        .init();
    info!(some = "thing"; "Hello, world!");
}

And when I run this I get this:
image

Any ideas? Am I missing anything or doing something wrong?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions