Reputation: 1536
I am trying to use Plack::Middleware::DBIC::QueryLog inside of a dancer application. The documentation tells me to get the querylog like this:
use Plack::Middleware::DBIC::QueryLog;
sub get_querylog_from_env {
my ($self, $env) = @_;
Plack::Middleware::DBIC::QueryLog->get_querylog_from_env($env);
}
In my dancer app before accessing my database schema I have to set $schema->storage->debugobj
to the QueryLogger
.
My question is: How can I access the environment $env
provided by Plack which contains the QueryLog object I'm
supposed to use?
I am starting my dancer application with
plackup bin/app.pl
where app.pl
contains the default
use Dancer;
use app;
dance;
Upvotes: 0
Views: 123
Reputation: 5279
Have you tried
request->env();
from within your app.pm itself? See Dancer::Request. It's not a Plack::Request object, but judging from the source, it does contain PSGI ENV vars.
Upvotes: 1