It seems that when build_per_context_instance is called, it creates a new
DBIx::Class::QueryLog object, and thanks to bug #53634 it now passes querylog_args to
the constructor (which is very useful).
Unfortunately it appears that the debugfh property of the DBIx::Class::QueryLog object
doesn't take a value from the constructor, it needs to be explicitly set via the
debugfh() method after object creation.
I'd really like to be able to set this value via querylog_args and I can see a few
solutions to make this possible.
1 - Patch Catalyst::TraitTor::Model::DBIC::Schema::QueryLog
If you added the line:
$querylog->debugfh($querylog_args->{debugfh}) if $querylog_args->{debugfh};
Just below the object constructor, then setting debugfh in querylog_args will correctly
make it through to the DBIx::Class::QueryLog object.
2 - Patch DBIx::Class::QueryLog
If there was a debugfh attribute declared (via Moose) in this object, then the magic
Moose constructor would set the value for you at object construction time.
has debugfh => (
is => 'rw',
);
I'm not really sure what the "correct" option is, but if you think it's the latter, I'm
happy enough to try filing a bug report against DBIx::Class::QueryLog instead.