> -----Original Message-----
> From: Lyle Brooks [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 17, 2001 11:45 AM
> To: [EMAIL PROTECTED]
> Subject: Querying Apache Configuration
> 
> 
> I've been studying Chapter 8 "Customizing the Apache Configuration 
> Process" in the Eagle book, and working through some test modules.
> 
> In the process, I been wondering is it possible to peek at the
> configuration directives/values of other modules (both Perl and C)
> via mod_perl?

sort of - in both instances you have to do some tricks and break
encapsulation.  for Perl you have to get the module's configuration using
Apache::ModuleConfig->get($r, package) where package- is the class of the
class in question.  for C it's a bit trickier and may not work on all
platforms (it doesn't on windows) but you can check the archives for Doug's
example of getting mod_auth's AuthName directive if you really want to.

basically, though, the data you are after is private and should only be
retrieved via the public interface.  but this is Perl, so you are more asked
to play fair than you are required, and mod_auth doesn't have an
interface...

> 
> Also, in my tests I tried the following code..
> 
>    my $fname = $r->server->error_fname;
>    $log->debug("error log filename = $fname");
> 
>    my $loglevel = $r->server->loglevel;
>    $log->debug("loglevel = = $loglevel");
> 
> and to my surprise they worked and came back with values.  ($fname
> with the value of my ErrorLog directive, and $loglevel with 7 which
> corresponds to the debug level my LogLevel directive was set to.

error_fname was added a few months ago, as was loglevel - loglevel is
documented I think, but not error_fname.

the constants for loglevel are newconstsubs and are only available in
5.005+, but are Apache::Log::EMERG, etc, corresponding to the LogLevel
settings...

both or writable, BTW :)

> 
> error_fname() is not documented (at least my eyes didn't find it in
> the Eagle book), but to my surprise it worked.  I later found it
> in the mod_perl sources.  
> 
> loglevel() does not appear to be documented either, nor did I find a
> sub for it in the mod_perl source.  Why did that work?  Is there 
> some AUTOLOADing going on here?

loglevel is in Log.xs, as are the constants

BTW, all of these will covered in detail someplace arriving soonish :)

--Geoff
 

Reply via email to