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

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.

  • Comment on Re^3: Custom Apache ErrorLog Using mod_perl

Replies are listed 'Best First'.
Re^4: Custom Apache ErrorLog Using mod_perl
by tadman (Prior) on Aug 28, 2002 at 22:50 UTC
    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.

        Yes, and no. It affects the way that the STDERR stuff is processed from within mod_perl, but not Apache, so it's an 80% solution. I think with a bit of hackery, I might get what I'm looking for.