Re: Value of ErrorLog directive via mod_perl

2000-09-26 Thread Bjørn Ola Smievoll

* Doug MacEachern
|
| On 15 Sep 2000, Bjørn Ola Smievoll wrote:
| 
|  I need to retrieve the value of the ErrorLog directive (i.e. the path
|   filename of the error_log), but I can't find a way to do it with
|  mod_perl.  (The C api equivalent is the error_fname field in the
|  server_rec struct).
| 
| this patch should work.  can you tell me why you need it so i can decide
| if this should be added to the distribution?

I want to return the last 5 lines or so of the error_log each time
there's a 500 error.  The faculty and students ordinarily don't have
access to the error log, so it will be helpful for them to see the
last lines from the log file to help them fix problems with their
documents (mostly wrong file perms and stuff like that).

I could hardcode the value, but since we distribute our server package
to well over 50 servers, some running multiple virtualhosts, I doubt
that would work very well.

(From a security standpoint this might not be the best idea, so I'll
probably limit it to lines that start with [ (so not to return the
occasional perl code dump) and to our local domain as it's only useful
if you're able to fix the problem as well (useful in an
non-evil-minded context that is)).


Thanks,

(bo)



Re: Value of ErrorLog directive via mod_perl

2000-09-26 Thread Doug MacEachern

On 26 Sep 2000, Bjørn Ola Smievoll wrote:
 
 I want to return the last 5 lines or so of the error_log each time
 there's a 500 error.  The faculty and students ordinarily don't have
 access to the error log, so it will be helpful for them to see the
 last lines from the log file to help them fix problems with their
 documents (mostly wrong file perms and stuff like that).
 
 I could hardcode the value, but since we distribute our server package
 to well over 50 servers, some running multiple virtualhosts, I doubt
 that would work very well.

ok, that does sound useful.  i've committed the patch to cvs.




Re: Value of ErrorLog directive via mod_perl

2000-09-25 Thread Doug MacEachern

On 15 Sep 2000, Bjørn Ola Smievoll wrote:

 I need to retrieve the value of the ErrorLog directive (i.e. the path
  filename of the error_log), but I can't find a way to do it with
 mod_perl.  (The C api equivalent is the error_fname field in the
 server_rec struct).

this patch should work.  can you tell me why you need it so i can decide
if this should be added to the distribution?

Index: src/modules/perl/Server.xs
===
RCS file: /home/cvs/modperl/src/modules/perl/Server.xs,v
retrieving revision 1.6
diff -u -r1.6 Server.xs
--- src/modules/perl/Server.xs  1999/08/20 08:34:43 1.6
+++ src/modules/perl/Server.xs  2000/09/25 20:12:57
@@ -135,6 +135,16 @@
 #  char *names;/* Wildcarded names for HostAlias servers */
 #  char *virthost; /* The name given in VirtualHost */
 
+char *
+error_fname(server)
+Apache::Server server
+
+CODE:
+RETVAL = server-error_fname;
+
+OUTPUT:
+RETVAL
+
 int
 timeout(server, set=0)
 Apache::Server server




Value of ErrorLog directive via mod_perl

2000-09-15 Thread Bjørn Ola Smievoll

I need to retrieve the value of the ErrorLog directive (i.e. the path
 filename of the error_log), but I can't find a way to do it with
mod_perl.  (The C api equivalent is the error_fname field in the
server_rec struct).

Any hints?

Thanks,
(bo)