Hi!

I know the problem... Indeed: http://httpd.apache.org/docs/logs.html#errorlogsays:

" It is not possible to customize the error log by adding or removing information."

For my part, I wrote an error handler module, that processes all errors my application produces. That means I don't warn or die, I call my $err->raise(666, 'devil!'), $err->warn(665, 'almost devil!'), etc. methods, who will put messages in my application logfile (where I can put the request, and additional debugging information alongside the actual error message.), and then die, warn or even take corrective measures. Also, these handlers will print error messages in whatever content type (text/plain, text/html, or text/xml) the client requested automatically.

So the apache log will present only true low level erros (404, 403, server start/stop etc.) and occasionally internal server errors (500), which almost always are what I call production only runtime errors -- bugs that didn't strike during testing, due to smaller load or user interaction not anticipated in test runs... (yep, these things happen to me... ;), or simple syntax errors when testing new code.

In those cases I normally don't need to know the exact request that caused the error -- since the erronous file and line number are logged, I normally find the error by looking at my code... ;)

Any true application level errors are logged in my application's log, where they belong, IMHO.

Spamming the log might help on a low-volume or single child server, but won't do during rapid fire "attacks" by your clients.

I am not an expert in this, but it might be possible to write a mod_perl handler that intercepts error logging.

I also think it's a good wishlist item for the apache project to have a request id/PID in all logfiles, and/or means of customizing the error log format. A combined access/error log would be fine too.


In reply to Re: Custom Apache ErrorLog Using mod_perl (use an application errlog) by Flexx
in thread Custom Apache ErrorLog Using mod_perl by tadman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.