Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Logging run-time warnings from an embedded perl interpreter

by Corion (Patriarch)
on Nov 19, 2007 at 19:19 UTC ( #651734=note: print w/replies, xml ) Need Help??


in reply to Re^2: Logging run-time warnings from an embedded perl interpreter
in thread [RESOLVED*] Logging run-time warnings from an embedded perl interpreter

I haven't had to do that, but maybe the following works for you?

BEGIN { close STDERR; my $logfile = '/some/hardcoded/path/where/to_put_your.log'; open STDERR, ">", $logfile or die "Couldn't create logfile: $!"; };

Put that code somewhere where it gets run as early as possible (for user code) - maybe you can even specify modules to be loaded when you start the program?

Replies are listed 'Best First'.
Re^4: Logging run-time warnings from an embedded perl interpreter
by Hercynium (Hermit) on Nov 19, 2007 at 20:16 UTC
    Thanks for the code snippet. I just put that code into a 'reboot handler' (something custom I built that *should* have been part of the app in the first place) and sure enough I'm getting all sorts of fun stuff in my log file...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2023-02-05 17:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (32 votes). Check out past polls.

    Notices?