Skip to content

Document how to add app-specific Fields #45

@jwhitlock

Description

@jwhitlock

The mozlog format allows for a Fields hash of application-specific fields. This is a useful feature for structured logging, and it should be documented how to access it.

As discovered in mozilla.fx-private-relay, this can be populated through the extra parameter:

logger.info(
    "Subsystem foo running at foo.example.com:4021",
    extra: {"phase": "started", "host": "foo.example.com", "port": 4021})

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