Steve Hay wrote:
[...]
Works for me too. I've now got 700kB+ in the error_log from running the testsuite. That looks better!

I changed the patch that I applied very slightly to the attached, which seems to make a little more sense to me.

- Steve


------------------------------------------------------------------------


--- modperl_log.c.orig 2003-04-03 07:25:26.000000000 +0100
+++ modperl_log.c 2003-09-22 09:05:17.081033600 +0100
@@ -2,6 +2,7 @@
#include "apr_lib.h"
#include "modperl_trace.h"
#include "modperl_log.h"
+#include "mod_perl.h"
#undef getenv /* from XSUB.h */
@@ -25,6 +26,8 @@
apr_size_t vstr_len = 0;
va_list args;
+ logfile = modperl_global_get_server_rec()->error_log;
+
if (!logfile) {
return;
}
@@ -67,7 +70,5 @@
debug_level |= 0x80000000;
- logfile = s->error_log; /* XXX */
-
MP_TRACE_a_do(MP_TRACE_dump_flags());
}

It was a proof of concept hack, so it doesn't matter where you put it, it't not the way to go since you don't want to call modperl_global_get_server_rec() on each trace, even while debugging.


Please try this patch (of course first reverting the previous attempt ;)

Index: src/modules/perl/mod_perl.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
retrieving revision 1.185
diff -u -r1.185 mod_perl.c
--- src/modules/perl/mod_perl.c 16 Sep 2003 18:47:53 -0000      1.185
+++ src/modules/perl/mod_perl.c 23 Sep 2003 00:57:24 -0000
@@ -598,6 +598,12 @@
     MP_dSCFG(s);
     dTHXa(scfg->mip->parent->perl);
 #endif
+
+    /* httpd core open_logs handler re-opens s->error_log, which
+     * might get a different value on OSes which don't talk
+     * filedescriptors, reset the logfile */
+    modperl_trace_logfile_set(s->error_log);
+
     ap_add_version_component(pconf, MP_VERSION_STRING);
     ap_add_version_component(pconf,
                              Perl_form(aTHX_ "Perl/v%vd", PL_patchlevel));
Index: src/modules/perl/modperl_log.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_log.c,v
retrieving revision 1.8
diff -u -r1.8 modperl_log.c
--- src/modules/perl/modperl_log.c      3 Apr 2003 06:25:26 -0000       1.8
+++ src/modules/perl/modperl_log.c      23 Sep 2003 00:57:24 -0000
@@ -19,6 +19,11 @@
     return debug_level;
 }

+void modperl_trace_logfile_set(apr_file_t *logfile_new)
+{
+    logfile = logfile_new;
+}
+
 void modperl_trace(const char *func, const char *fmt, ...)
 {
     char vstr[8192];
@@ -67,7 +72,7 @@

debug_level |= 0x80000000;

-    logfile = s->error_log; /* XXX */
+    modperl_trace_logfile_set(s->error_log);

     MP_TRACE_a_do(MP_TRACE_dump_flags());
 }
Index: src/modules/perl/modperl_log.h
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_log.h,v
retrieving revision 1.10
diff -u -r1.10 modperl_log.h
--- src/modules/perl/modperl_log.h      14 Aug 2002 14:54:47 -0000      1.10
+++ src/modules/perl/modperl_log.h      23 Sep 2003 00:57:24 -0000
@@ -26,6 +26,8 @@
 #define MP_TIDF \
 (unsigned long)modperl_thread_self()

+void modperl_trace_logfile_set(apr_file_t *logfile_new);
+
 unsigned long modperl_debug_level(void);

#ifdef WIN32


__________________________________________________________________ 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