Skip to content

Add Global context fields when creating ecs_logging.StdlibFormatter #57

Closed
@rdifrango

Description

@rdifrango

I know that based upon the work associated with #7 that context fields can be added to a given logging record, but what I would like to set is a default group that are populated on all log records and then any that are added via the extras on a given record they are added.

So I'd like to be able to do something like:

handler.setFormatter(ecs_logging.StdlibFormatter(extra={"environment": "dev"}))

Related discussion on the nodejs logger here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions