Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: Gettign a logger with Log::Log4perl

by nikmit (Sexton)
on Oct 31, 2016 at 16:04 UTC ( [id://1175023]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1175023]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-25 06:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found