This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigFC13BB2B609551458162C62C
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Dan Thomas wrote:
> Hi,
>=20
> I'm in the process of shifting some old mod_perl1 code over to
> Apache2.2 and mod_perl2. Part of it is using Apache::LogFile to write
> to a custom log. Well.. actually, it pipes the data to a little script
> that collects up lines and forks off processes to deal with them when
> it's got a handful (it gets hit a couple of million times per day, and
> processing them one by one isn't particularly efficient). But that's
> not entirely relevant, I suppose.
>=20
> As far as I can tell, Apache::LogFile was never ported to mp2, and I
> can't find anything that will let me define my own logfile. The
> Apache::LogFile solution was very convenient, as it shuts down and
> restarts the collector script with the daemon, but as my C skills are
> practically non-existent, I doubt very much I'd be able to port it
> myself, so I'm looking for an alternative.


Porting it to mod_perl 2 would certainly possible, but require some
surgery and XS/C code, unfortunately. On the bright side, the Apache
logging api in 2.0 is much nicer, so it would most likely end up being
less code.

> Ideally, I want a single filehandle that will be opened and closed
> when Apache starts up and shuts down, that I can write to from a
> handler, but I'm not really sure where to start. Can anyone point me
> in the right direction?


You could probably handle it nicely from a LogHandler

http://perl.apache.org/docs/2.0/user...PerlLogHandler

Load your module at startup, opening your file then. Collect the informat=
ion
you are interested in logging any way you see fit ($r->notes, $r->pnotes =
are
good candidate), then use a LogHandler to do the final step. Buffer up to=

a certain amount of data, check the filehandle is still good (if not, fix=
it),
then proceed to do whatever you used to.

Not quite as elegant as Apache::LogFile, but would work just fine. Portin=
g
Apache::LogFile would be nicer still,...

------------------------------------------------------------------------
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm)\.org/


--------------enigFC13BB2B609551458162C62C
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHDHAnyzKhB4jDpaURArIeAJwP8lAUeJNfdohTWchJGH 7xF30AzQCfYXd3
nHwu0uR3mnjc+WmbZxb2tlA=
=K9J+
-----END PGP SIGNATURE-----

--------------enigFC13BB2B609551458162C62C--