in reply to Re: Custom Apache ErrorLog Using mod_perl
in thread Custom Apache ErrorLog Using mod_perl

I'm thinking I can just spam the ErrorLog at the beginning of each request, and that with a piped error-log handler, I can re-format it back in to something sensible, stripping out "empty" errors.

I'm using CGI::Carp of course, but the errors it cranks out are free-form, just like you'd expect.
  • Comment on Re^2: Custom Apache ErrorLog Using mod_perl

Replies are listed 'Best First'.
Re^3: Custom Apache ErrorLog Using mod_perl
by Aristotle (Chancellor) on Aug 28, 2002 at 22:16 UTC
    I don't quite follow.. does CGI::Carp prefix your errors with a nice identifier and timestamp, or not? If yes, what exactly is the problem?

    Makeshifts last the longest.

      It does, but there's no session information. For example, using this:
      [Fri Nov 17 21:40:43 1995] test.pl: I'm confused at test.pl line 3.
      Which 500 error entry in your TransferLog corresponds to it? I'm trying to tag them according to a contrived "transmission identifier" which is stashed in an Apache note using a custom Handler.

      These "transmission identifiers" are put into the Apache log by changing the LogFormat:
      LogFormat "%{TAG}n %h %{%s}t (etc)..."
      Which results in a log that looks like:
      2777C6E63D6D48F0 11.22.33.44 1030572273 ...
      What I'm trying to do is insert, some how, the 'TAG' note into the ErrorLog stream as well. This is so I have a way of binding the error to the failed request in a very reliable way.

      In actuality, I could care less about the timestamp. In fact, I would much rather it wasn't there. What I need is to put the 'TAG' in the output, something like this:
      2777C6E63D6D48F0: test.pl: I'm confused at test.pl line 3.
        Sounds like CGI::Carp's set_message is what you want, then.

        Makeshifts last the longest.