Subject: | Increasing log level above debug breaks rendering of actionless routes in Mojolicious |
If a Mojolicious application is using automatic rendering without a controller (only a template)
and the log-level is set above debug, these actionless routes will throw an error:
http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Automatic_rendering
This is because the "debug" method is returning false when using MojoX::Log::Log4perl and
the log level is set above "debug." Specifically it is this line in Mojolicious::Routes that
exposes the problem:
$c->app->log->debug("$app does not exist, maybe a typo?") and return
unless ref $e;
MojoX::Log::Log4perl should probably maintain the return values of Mojo::Log and return true
in these cases for compatibility purposes.
The workaround is to set the logger to DEBUG but bump the level up on appenders. This
works around the problem, but isn't ideal.