Ken Miller wrote:
> I'd like to write some status messages to the error_log during server
> startup. So, I tried
>
> Apache->server->log_error( "..." )
>
> but it doesn't work. This works fine in the child processes. Is the log
> file not ready to write to during server startup? Printing to STDERR does
> not work either.
>
> It's not that important, but I'd like to know regardless.
I'm not sure exactly of the mechanism here, but I know a few people
have asked before. from what I can tell, it seems like Apache binds
stuff like warn() and the log functions to error_log between the first
and second startups. for instance, I have a bunch of warn()
statements in my startup.pl:
warn "ErrorLog ", Apache->server->error_fname;
and the first pass sends them to STDERR, and the second pass goes to
the error_log (at least that's how it appears to work).
I'm not sure how Apache->server->log_error is supposed to work here,
but there is some code in Apache.xs that errors "error_log not open
yet" under certain conditions.
at any rate, warn() should be able to work for you.
HTH
--Geoff