You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Chad N. Tindel" <ct...@falcon.csc.calpoly.edu> on 2002/12/11 03:49:11 UTC

References to Documentation?

Hi all-

I'm new to Apache 2.0 development, so I'm trying to come up to speed on
the design and code.  I've been looking around for some documentation
regarding the lifecycle of a request, and haven't found much detail.

In particular, I'm trying to figure out at what spot in the does the entry in
the access_log get written.  I would expect it to be perhaps at the end of
core_output_filter or something like that.  And the log.c file only has
functions to log errors, but not accesses.

If someone has some quick pointers to documentation or a function name I'd
be very appreciative.

Thanks!

Chad


Re: References to Documentation?

Posted by "Chad N. Tindel" <ct...@falcon.csc.calpoly.edu>.
> > In particular, I'm trying to figure out at what spot in the does the
> > entry in the access_log get written.  I would expect it to be perhaps at
> > the end of core_output_filter or something like that.  And the log.c
> > file only has functions to log errors, but not accesses.
>
> Take a look at mod_log_config... it's done from a hook.  :)

Oh.. infinitely useful.  Thanks for the pointer.  I'm to the point where I
can compile my own module now.  Just for the sake of putting this stuff in
the archive (and maybe someone can comment as whether or not this needs to
be fixed in CVS):

1.  The modules/experimental/README says that you need to do a
"--enable-mymodule" in order to get a new module to build.  I've found
that in order to get my stuff into the makefiles I had to do a
"--with-module=experimental:mymodule" instead.

2.  I needed to add "experimental" to the MODULE_DIRS line in
build/config_vars.mk.

I'll be happy to post a patch if everybody else thinks these are the right
fixes.

Chad


Re: References to Documentation?

Posted by Cliff Woolley <jw...@virginia.edu>.
On Fri, 13 Dec 2002, Chad N. Tindel wrote:

> I'd like to write a module that provides alternative logging options, in
> addition to the current logging options.

You mean logging to databases and that sort of thing?  Okay...

But a handler really isn't what you want.  A handler's job is just to take
a request and generate the response from it (or at least begin the
response generation process).  The default handler, for example, just
takes the file corresponding to the request, opens it, and passes the open
file descriptor along.

I suggest studying mod_log_config in detail and understanding how it does
its thing.  Because it really sounds like you just want to write another
logging module... so yours will be a lot like mod_log_config; the output
will just go to something other htan a file.  And assuming you mean Apache
2.0 here, you can even get away with letting mod_log_config do most of the
work and just use the optional functions ap_log_set_writer_init and
ap_log_set_writer exported by that module to have it store the logs to
something other than a file.  Lots of possibilities there.

--Cliff


Re: References to Documentation?

Posted by "Chad N. Tindel" <ct...@falcon.csc.calpoly.edu>.
> > In particular, I'm trying to figure out at what spot in the does the
> > entry in the access_log get written.  I would expect it to be perhaps at
> > the end of core_output_filter or something like that.  And the log.c
> > file only has functions to log errors, but not accesses.
>
> Take a look at mod_log_config... it's done from a hook.  :)

Thanks for your help.  I was wondering if I could pick your brain for just
a little bit more info... I'm not sure if what I want to do is possible,
so feel free to just tell me so.  :)

I'd like to write a module that provides alternative logging options, in
addition to the current logging options.  I think a good way to do it
would be to write a handler that gets invoked every time a page gets
loaded.  However, I can't figure out from reading the docs how one would
do so.  I mean, I don't want to do an AddHandler because you have to give
it a file type, and I want this done for every access.  But a SetHandler
wouldn't work, because I don't want mine to be the ONLY handler.  I just
want mine to run in addition to everything else the user has configured.

Is this possible?

Thanks,

Chad


Re: References to Documentation?

Posted by Cliff Woolley <jw...@virginia.edu>.
On Tue, 10 Dec 2002, Chad N. Tindel wrote:

> In particular, I'm trying to figure out at what spot in the does the
> entry in the access_log get written.  I would expect it to be perhaps at
> the end of core_output_filter or something like that.  And the log.c
> file only has functions to log errors, but not accesses.

Take a look at mod_log_config... it's done from a hook.  :)

--Cliff