Skip Menu |

This queue is for tickets about the Log-Any-App CPAN distribution.

Report information
The Basics
Id: 96281
Status: rejected
Priority: 0/
Queue: Log-Any-App

People
Owner: Nobody in particular
Requestors: freetransform [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: feature request: custom extra fields
Date: Fri, 6 Jun 2014 17:31:35 +0400
To: bug-Log-Any-App [...] rt.cpan.org
From: Кирилл Матусов <freetransform [...] gmail.com>
Hello, I'd like to be able to pass arbitrary string as an extra field and access it using pattern like "[requestid pid %P] [%d] %m%n". Sometimes it's hard to locate desired log lines using only timestamps/pid but it becomes simple once you've added some request id or similar field. Moreover by passing this id value through different parts of distributed system you can track the whole flow easily. Using Log4perl it's possible via MDC feature by putting value Log::Log4perl::MDC->put("request_id", $req->headers("X-Request-Id")); and adding %X{request_id} to appender's ConversionPattern -- Best regards, Kirill
On Fri Jun 06 09:31:44 2014, freetransform@gmail.com wrote: Show quoted text
> Hello, > > I'd like to be able to pass arbitrary string as an extra field and access > it using pattern like "[requestid pid %P] [%d] %m%n". > Sometimes it's hard to locate desired log lines using only timestamps/pid > but it becomes simple once you've added some request id or similar field. > Moreover by passing this id value through different parts of distributed > system you can track the whole flow easily. > > Using Log4perl it's possible via MDC feature by putting value > Log::Log4perl::MDC->put("request_id", $req->headers("X-Request-Id")); > and adding %X{request_id} to appender's ConversionPattern >
I believe this wishlist should be redirected to Log-Any, as Log::Any the one doing the formatting (specifically, in Log::Any::Adapter::Core). Remember that Log::Any::App is just a wrapper/shortcut for using Log::Any + Log::Log4perl adapter. BTW, Log::Any is currently just using Perl's sprintf(). Closing this ticket as rejected for now. Regards, Steven
Wait, I'm a little confused, are you referring to Log::Any::App's pattern? If so, then it's all Log::Log4perl now anyway. If not, please explain more clearly what you meant with some example code.