I have used Log::Log4perl is production with Apache and mod_perl2, although not in very high traffic applications. So what are the performance impacts of (log4perl) logging in a high traffic web application? The answer is, as always, it depends.

Running in DEBUG mode (full detail) can seriously slow down performance, so you should be careful when setting up your loggers, appenders and levels. Also, very verbose logging can make the logs hard to read, and you can keep less history than if you were less verbose.

Benchmarking your application with different log4perl settings is important to understand how it affects you in your environment. Perhaps you should experiment with different disk setups, such as having /var/log/ on a separate disk system? Your I/O performance will most likely be one of the most important factors.

Do also keep an eye on the is_level functions in order to minimize impact of suppressed messages:

if($logger->is_error()) { $logger->error("Erroneous array: @super_long_array"); }
--
No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]

In reply to Re: Apache and log4perl (high performance logging?) by andreas1234567
in thread Apache and log4perl (high performance logging?) by zerohero

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.