Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
klaernie opened this issue Jun 30, 2023 · 0 comments
Open

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

klaernie opened this issue Jun 30, 2023 · 0 comments

Comments

@klaernie
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant