Skip to content

it would be cool if MDC->put accepts multiple key value pairs #125

@klaernie

Description

@klaernie

It would be really nice if one could pass in multiple key value pairs at the same time:

Log::Log4perl::MDC->put(
       foo_http_code => $code,
       foo_http_msg => $msg,
);

Right now it needs to be coded this way in order to be working:

Log::Log4perl::MDC->put( foo_http_code => $code );
Log::Log4perl::MDC->put( foo_http_msg => $msg );

Sadly I stumbled over this after debugging my way through our stack, until I noticed that always just the first pair was being passed on. Well, that's what I get for rushing to switch to log4perl.

From a cursory look it seems like it should be fairly easy to implement, and even be a good beginner PR. I'll try to implement this myself, unless I totally forget.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions