Dear Monks,

I humbly bow to your excellencies and salute your collective knowledge of all things Perl. I've got a problem here with mod_perl and specifically Apache2::Log.

Perl Apache2::Log documentation (http://perl.apache.org/docs/2.0/api/Apache2/Log.html), there is a way to stop Apache from prefixing one's nicely formatted log messages. Despite all my tries, I cannot get the claimed solution to work.

===START Apache2::Log API documentation snippet===
Apache2::Const::LOG_STARTUP
is useful for startup message where no timestamps, logging level is wanted. For example:
use Apache2::Const -compile => qw(:log);
use APR::Const -compile => qw(SUCCESS);
$s->log_serror(Apache2::Log::LOG_MARK,
Apache2::Const::LOG_INFO,
APR::Const::SUCCESS,
"This log message comes with a header");

will print:

Wed May 14 16:47:09 2003 info This log message comes with a header

whereas, when Apache2::Const::LOG_STARTUP is binary ORed as in:

use Apache2::Const -compile => qw(:log);
use APR::Const -compile => qw(SUCCESS);
$s->log_serror(Apache2::Log::LOG_MARK,

Apache2::Const::LOG_INFO|Apache2::Const::LOG_STARTUP,
APR::Const::SUCCESS,
"This log message comes with no header");

then the logging will be:

This log message comes with no header
===END Apache2::Log API documentation snippet===

I've tried so many things but I still fail in getting rid of "Wed May 14 16:47:09 2003 info" in this example. My code looks just like the example. Please help. I think this documentation is incorrect or out of date. Thanks!


In reply to Apache2::Log, please don't headerize my log messages by SeanM

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.