Hello shmem,

Thanks for you reply.

i call redirect_elog the first thing in the program and i tried the other approach too ie  open(STDERR, ">>$file") or die, it still gives the same problem.

The code i have is something like this.
#!/usr/local/bin/perl -wT use strict; use TEST::App::MainApp; $SIG{__WARN__} = \&warn_handler; redirect_error_log("/export/home/rdave/logs/error_log"); my $app = TEST::App::MainApp() $app->run_loop(); use constant MAX_MSGLEN => 1022; sub warn_handler { my $msg = join "", @_; # print to STDERR $msg = "[" . "$$|" . time2iso() . "] " . $msg; # send in chunks, if necessary while (length $msg > MAX_MSGLEN) { my $chunk = substr($msg, 0, MAX_MSGLEN); $msg = substr($msg, MAX_MSGLEN); warn $chunk, "\n"; } warn $msg; }
Then in the run_loop in another package

sub run_loop { my ($self) = @_; my $requester = $self->requester; $self->{_REQUEST_NUMBER}=0; # initialize the request counter while (my $input = $requester->new_request()) { $self->_reset_timings; # start request timing begin_timing('REQUEST'); $self->scratch->init; ++$self->{_REQUEST_NUMBER}; warn "[--] Starting a new request $self->{_REQUEST_NUMBER} (Cl +ient: $ENV{REMOTE_ADDR}) ...\n"; $self->{_INPUT} = $input; # read application configuration $self->config_object->getConfig($self->name()); # process request $self->_process_request; # finish the request $requester->close_request(); $self->invoke_post_request_callbacks; # end request timing $self->timing('REQUEST', time_since('REQUEST')); warn "[--] Finished handling request $self->{_REQUEST_NUMBER} +...\n"; $self->post_request; }
I am not changing or redirecting STDERR anywhere else in the program other than the first time. In the above code snippet the first warn goes to /usr/local/apache/logs/error_log and the bottom one goes to local log file. The code is spread over 1000s of lines, so sorry could'nt post it, but one thing is sure, that the program is not touching STDERR/redirect_elog/LCSTDERR elsewhere and this one works fine with perl 5.6.1 and behaving this way with perl 5.8.5

In reply to Re^2: fastcgi stderr redirect problems by zuser
in thread fastcgi stderr redirect problems by zuser

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.