Vivek Khera wrote:

On Aug 19, 2004, at 3:03 AM, Stas Bekman wrote:

And I'm still trying to figure out whether it's possible to make 'a plain warn()' log into the vhost log (die already logs into the vhost log). I haven't yet checked how it worked in mp1, I think it never did.


A plain warn() in mp1 does end up in the error_log. I use it for debugging all the time.

It's not plain warn(), it's imported one with:

  use Apache 'warn';

Or did you mean something else, Vivek?

OK, I wrote a modperl1 test suite
http://apache.org/~stas/warn-test-mp1.tar.gz
and indeed all go the vhost's error_log.
(t/htdocs/error_log in the test suite)

The only problem is the internal warn which doesn't. e.g.:

  # internal warning
  my $x = "aaa" + 1;

ends up in the main error_log.

I tried to workaround that with:

  *CORE::GLOBAL::warn = \&Apache::warn;

but got a segfault:

#0 0x2f3a2e3a in ?? ()
#1 0x402720f1 in fputs () from /lib/tls/libc.so.6
#2 0x080dce41 in log_error_core (file=0x810e7d1 "Apache.c", line=2001,
level=12, s=0x813425c, r=0x0, fmt=0x810f76b "%s",
args=0xbfffeb44 "x� [EMAIL PROTECTED]") at http_log.c:452
#3 0x080dceb2 in ap_log_error (file=0x810e7d1 "Apache.c", line=2001,
level=12, s=0x813425c, fmt=0x810f76b "%s") at http_log.c:469
#4 0x080a69dd in XS_Apache_log_error (my_perl=0x8135740, cv=0x81e60b4)
at Apache.c:2001
#5 0x40135f65 in Perl_pp_entersub (my_perl=0x8135740) at pp_hot.c:2854
#6 0x4011193f in Perl_runops_debug (my_perl=0x8135740) at dump.c:1442
#7 0x400b7b6e in S_call_body (my_perl=0x8135740, myop=0xbfffeda0, is_eval=0)
at perl.c:2285
#8 0x400b76aa in Perl_call_sv (my_perl=0x8135740, sv=0x81e3448, flags=4)
at perl.c:2203
#9 0x0808b355 in perl_call_handler (sv=0x81e3448, r=0x8206d34, args=0x0)
at mod_perl.c:1668
#10 0x0808a265 in perl_run_stacked_handlers (hook=0x810bfe7 "PerlHandler",
r=0x8206d34, handlers=0x814d31c) at mod_perl.c:1381
#11 0x08087123 in perl_handler (r=0x8206d34) at mod_perl.c:904
#12 0x080d4c0f in ap_invoke_handler (r=0x8206d34) at http_config.c:518
#13 0x080e9802 in process_request_internal (r=0x8206d34) at http_request.c:1324
#14 0x080e9861 in ap_process_request (r=0x8206d34) at http_request.c:1340
#15 0x080e0975 in child_main (child_num_arg=0) at http_main.c:4653
#16 0x080e0bdd in make_child (s=0x812a04c, slot=0, now=1093136593)
at http_main.c:4823
#17 0x080e0c83 in startup_children (number_to_start=1) at http_main.c:4850
#18 0x080e1329 in standalone_main (argc=9, argv=0xbffff174) at http_main.c:5169
#19 0x080e1b47 in main (argc=9, argv=0xbffff174) at http_main.c:5511


Let's see if we can get this sorted out at least in mp2.

--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to