You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Shibi NS <sh...@gmail.com> on 2009/11/12 13:01:09 UTC

possible issue in mod_perl 2.0.4 with respect to STDERR

Configuration error log is in my applications httpd config file is


ErrorLog = "'| rotatelogs \log\error_log 1M "'

But if print something on STDERR from mod_perl program , Say debug print
(print STDERR "DEBUG ";) this is going to \log\error_log instead of
\log\error_log.NNN

Is this is a mod perl issue or i am doing something wrong

--Shibi Ns--

Re: possible issue in mod_perl 2.0.4 with respect to STDERR

Posted by Shibi NS <sh...@gmail.com>.
No its not VHOST

The configuration in httpd look like this

<Perl>
    my $app_home     = $ENV{APPS_HOME};
    my $config            = ConfigLoader::include("$app_home/conf/
ursforms.pl");

    my $clog               = '"| rotatelogs '. $config->{log_accessfile} .
'%y%m%d 1M " common';
    my $elog               = '"| rotatelogs '. $config->{log_file} . '%y%m%d
1M "';

    $ServerAdmin      = $config->{contact};
    $ServerRoot         = $app_home;
    $DocumentRoot   = $app_home . "/webdocs";
    $ErrorLog            = $elog ;
    $CustomLog        = $clog;
    $PidFile              = $config->{log_pidfile};
    $LockFile            = $config->{log_lockfile};
    $ScoreBoardFile  = $config->{log_statusfile};
</Perl>
Where the $config->{log_file}  is
/nfs/private/user/sns/log/ursforms.myserver-44088.log

% ps -ef | grep ursforms | grep sns
sns      23265     1  0 04:21 ?        00:00:03 httpd -f
/m/isd/conf/ursforms.conf -D SYSTEST -D DEV
sns      23278 23265  0 04:21 ?        00:00:00 rotatelogs
/m/isd/log/ursforms.ap6415isd-44088.log%y%m%d 1M
sns      23279 23265  0 04:21 ?        00:00:00 rotatelogs
/m/isd/log/ursforms.ap6415isd-44088.access%y%m%d 1M
sns      23280 23265  0 04:21 ?        00:00:00 httpd -f
/m/isd/conf/ursforms.conf -D SYSTEST -D DEV
sns      23281 23265  0 04:21 ?        00:00:00 httpd -f
/m/isd/conf/ursforms.conf -D SYSTEST -D DEV
sns      23333 23265  0 04:21 ?        00:00:00 httpd -f
/m/isd/conf/ursforms.conf -D SYSTEST -D DEV
sns      27002 20796  0 05:07 pts/67   00:00:00 grep ursforms

Parent process info

% ls -lrt fd/
total 0
lr-x------    1 sns      g680           64 Nov 12 05:08 9 ->
pipe:[2129198375]
l-wx------    1 sns      g680           64 Nov 12 05:08 8 ->
pipe:[2129198353]
lr-x------    1 sns      g680           64 Nov 12 05:08 7 ->
/m/isd/conf/apps-forms.d/
lr-x------    1 sns      g680           64 Nov 12 05:08 6 ->
pipe:[2129198353]
lrwx------    1 sns      g680           64 Nov 12 05:08 3 ->
socket:[2129164640]
l-wx------    1 sns      g680           64 Nov 12 05:08 2 ->
pipe:[2129198354]
l-wx------    1 sns      g680           64 Nov 12 05:08 10 ->
pipe:[2129198375]
l-wx------    1 sns      g680           64 Nov 12 05:08 1 -> /dev/null
lr-x------    1 sns      g680           64 Nov 12 05:08 0 -> /dev/null

PWD /proc/23265

one of the child process info.

% ls -lrt  ../23279/fd
total 0
l-wx------    1 sns      g680           64 Nov 12 05:09 3 ->
/nfs/private/user/sns/log/ursforms.myserver-44088.access091112
l-wx------    1 sns      g680           64 Nov 12 05:09 2 ->
pipe:[2129198354]
l-wx------    1 sns      g680           64 Nov 12 05:09 1 -> /dev/null
lr-x------    1 sns      g680           64 Nov 12 05:09 0 ->
pipe:[2129198375]

Now what i don't under stand is when print STDERR why its printing to
/nfs/private/user/sns/log/ursforms.myserver-44088.log how does it know this
file ?

Shibi Ns

On Thu, Nov 12, 2009 at 6:20 PM, Torsten Foertsch
<to...@gmx.net>wrote:

> On Thu 12 Nov 2009, Shibi NS wrote:
> > Configuration error log is in my applications httpd config file is
> >
> >
> > ErrorLog = "'| rotatelogs \log\error_log 1M "'
> >
> > But if print something on STDERR from mod_perl program , Say debug
> > print (print STDERR "DEBUG ";) this is going to \log\error_log
> > instead of \log\error_log.NNN
> >
> > Is this is a mod perl issue or i am doing something wrong
>
> I suspect this ErrorLog directive resides inside a VHost?
>
> STDERR is bound to the programs notion of file descriptor 2 or whatever
> it is on windows, not to the ErrorLog.
>
> If you want to write to a VHost's ErrorLog use $r->log &co.
>
> See also
>
> http://www.gossamer-threads.com/lists/modperl/modperl/99241
> http://www.gossamer-threads.com/lists/modperl/modperl/99219
> http://www.gossamer-threads.com/lists/modperl/modperl/99504
>
> In addition to what is said here
> http://www.gossamer-threads.com/lists/modperl/modperl/99248#99248
> another way to capture STDERR could be a PERLIO layer or to tie STDERR
> to something.
>
> Torsten
>
> --
> Need professional mod_perl support?
> Just hire me: torsten.foertsch@gmx.net
>



-- 
--Shibi Ns--

Re: possible issue in mod_perl 2.0.4 with respect to STDERR

Posted by Torsten Foertsch <to...@gmx.net>.
On Thu 12 Nov 2009, Shibi NS wrote:
> Configuration error log is in my applications httpd config file is
>
>
> ErrorLog = "'| rotatelogs \log\error_log 1M "'
>
> But if print something on STDERR from mod_perl program , Say debug
> print (print STDERR "DEBUG ";) this is going to \log\error_log
> instead of \log\error_log.NNN
>
> Is this is a mod perl issue or i am doing something wrong

I suspect this ErrorLog directive resides inside a VHost?

STDERR is bound to the programs notion of file descriptor 2 or whatever 
it is on windows, not to the ErrorLog.

If you want to write to a VHost's ErrorLog use $r->log &co.

See also

http://www.gossamer-threads.com/lists/modperl/modperl/99241
http://www.gossamer-threads.com/lists/modperl/modperl/99219
http://www.gossamer-threads.com/lists/modperl/modperl/99504

In addition to what is said here
http://www.gossamer-threads.com/lists/modperl/modperl/99248#99248
another way to capture STDERR could be a PERLIO layer or to tie STDERR 
to something.

Torsten

-- 
Need professional mod_perl support?
Just hire me: torsten.foertsch@gmx.net