in reply to Re^3: Gettign a logger with Log::Log4perl
in thread Gettign a logger with Log::Log4perl
Thank you - that indeed worked but only comes to show I failed to provide an adequate example as the problem persisted in my application :)
I made an effort to further/better isolate the problem and I think I have a solution. I was starting Dancer2 with a system($plackup $args) command. After looking at the source code of plackup, I started it directly in a fork:
use Plack::Runner; if (my $ps = fork) { $log->info("successfully spawned PID $ps"); $SIG{CHLD} = "IGNORE"; } else { $log->info("starting Dancer2 as PID $$"); my @args = split(' ', $cmd); my $runner = Plack::Runner->new; $runner->parse_options(@args) or $log->logdie("Plack::Runner faile +d to parse startup options"); $runner->run or $log->logdie("failed to start Dancer2 app"); }
I need to check whether failures to start are captured correctly, but on the logging front its a win, plus it should be a better way to start it anyway
I still don't know why it was failing before - I did check that processes are running the same version of perl and @INC is the same when started via system() and directly
|
|---|