in reply to Re^2: Daemon, log4perl & stderr/stdout
in thread Daemon, log4perl & stderr/stdout
You need to make sure fileno(STDERR) is equal to 2.
fileno()==0 will be used as the child's STDIN.
fileno()==1 will be used as the child's STDOUT.
fileno()==2 will be used as the child's STDERR.
The above will allow you to redirect STDERR to a file, but system file handles (as opposed to Perl file handles) can't be redirected to a Perl function (such as the log4perl handler). If you wish to do that, you'll have to use a temporary file, IPC::Open3 or something like pc88mxer's code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Daemon, log4perl & stderr/stdout
by pc88mxer (Vicar) on May 27, 2008 at 23:17 UTC |