Skip Menu |

This queue is for tickets about the MojoX-Log-Log4perl CPAN distribution.

Report information
The Basics
Id: 97143
Status: resolved
Priority: 0/
Queue: MojoX-Log-Log4perl

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

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



Subject: MojoX::Log::Log4perl does not have atribute 'format'
Hi. MojoX::Log::Log4perl does not have atribute 'format'. But Mojo::Log have. This mismatch interfaces generates errors when using default templates.
From: ser.khomutov [...] gmail.com
This fixs problem has format => sub { \&_format }; sub _format { '[' . localtime(shift) . '] [' . shift() . '] ' . join("\n", @_, ''); }
On Wed Jul 23 10:35:02 2014, serkh wrote: Show quoted text
> This fixs problem > > has format => sub { \&_format }; > > sub _format { > '[' . localtime(shift) . '] [' . shift() . '] ' . join("\n", @_, ''); > }
Hi Sergei. Thanks for the report, and for using MojoX::Log::Log4perl! While your patch does fix the issue, it's just pushing Mojo::Log's format downstream, which makes little sense when using Log4perl. What I'm going to try instead is fixing the current appender's format and returning that string instead of logging it, which is what Mojo::Log's format() is supposed to do. Expect a patch sometime this week! Thanks again!
Hi Sergei, Log4perl doesn't seem to provide a way to reliably return the formatted message from the current layout, so in order to prevent Mojolicious' development 404 page from croaking, I've implemented your patch as is, adding just a warning message that people using this module should *not* use format(), and instead rely on the appenders' layouts to format their messages. I have also updated the docs with this information. Version 0.10 should hit your local CPAN mirror anytime :) Thanks again for letting me know of this issue, and please let me know if you bump into any other problems. Cheers!