Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: olivier.duclos [...] capabilis.com
Cc:
AdminCc:

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



Subject: Incompatibility with newer version of Mojolicious
Date: Thu, 6 Mar 2014 14:56:12 +0100
To: bug-MojoX-Log-Log4perl [...] rt.cpan.org
From: Olivier Duclos <olivier.duclos [...] capabilis.com>
Hi, Using Mojolicious 4.87 and MojoX::Log::Log4perl 0.08, when an error occures in Mojolicious, I get the following error : Event "read" failed: Can't locate object method "history" via package "Log::Log4perl::Logger" at inline template 3c057dacc1089aca8e7d6d310c180d08 line 233. 228: %= $kv->(Time => scalar localtime(time)) 229: </table> 230: </div> 231: <div class="tap">tap for more</div> 232: </div> 233: % if (@{app->log->history}) { 234: <div id="log" class="box infobox spaced"> 235: <table> 236: % for my $msg (@{app->log->history}) { 237: % my ($time, $level, @lines) = @$msg; 238: % $time = localtime $time; The default error page of Mojolicious cannot be displayed anymore because it calls app->log->history. This new 'history' function needs to be supported by MojoX::Log::Log4perl. Thanks, Olivier Duclos DevOps - Capabilis
Subject: Incompatibility with newer version of Mojolicious
Date: Mon, 10 Mar 2014 18:02:26 +0100
To: bug-MojoX-Log-Log4perl [...] rt.cpan.org
From: Olivier Duclos <olivier.duclos [...] capabilis.com>
This bug is pretty easy to fix. I've attached a patch which solves the problem. The "$self->unsubscribe('message')" prevents messages from being logged twice.

Message body is not shown because sender requested not to inline it.

Hi Olivier, I just released v0.09 of MojoX::Log::Log4perl which should fix this issue and also provide the history() and max_history_size() attributes, so the default Mojolicious templates don't bork anymore. It should hit your nearest CPAN mirror any minute now. I also took the opportunity to add a few more tests which should make this dist a bit more robust against such issues in the future (though this might still happen again should Mojolicious change its public log handling API again). Thanks for reporting and caring enough to suggest a patch. Please let me know if you bump into any issues. Oh, and thanks for using MojoX::Log::Log4perl =)