Skip Menu |

This queue is for tickets about the POE-Component-Log4perl CPAN distribution.

Report information
The Basics
Id: 44252
Status: new
Priority: 0/
Queue: POE-Component-Log4perl

People
Owner: Nobody in particular
Requestors: shawn.c.carroll [...] gmail.com
Cc:
AdminCc:

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



Subject: Format Issue using PoCo Log4perl, losing line number and source file
One issue w/ PoCo::Log4perl is that log4perl reads the line number and source file from PoCo::Log4perl. Can PoCo::Log4perl provide this information in a MDC variable? This will allow users to format their log w/ %X{sourceFile} and %X{sourceLine} instead of %F and %L. A proof of concept replacement from poe_logger: sub poe_logger { my ($heap, $arg0, $sourceFile, $lineNo, @args) = @_[HEAP, ARG0, CALLER_FILE, CALLER_LINE, ARG1 .. $#_]; my $message; my $log = Log::Log4perl->get_logger($heap->{_category}); if (ref($arg0)) { $log->log(%$arg0); } else { Log::Log4perl::MDC->put("sourceFile", $sourceFile); Log::Log4perl::MDC->put("sourceLine", $lineNo); $message = join("", $arg0, @args); $log->log($level, $message); Log::Log4perl::MDC->remove(); } }