http://qs321.pair.com?node_id=651734


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...