Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by Corion (Patriarch)
on Nov 19, 2007 at 19:19 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-25 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found