Hi Monks,

I have two modules:

I'm trying to get the following to happen:

  1. Log all INFO (and above) messages to run.log
  2. Only log ERROR messages from AA::Log to error.log and no where else.

I'm trying to use the additivity flag in Syncer2 to prevent ERROR messages from being passed up the hierarchy. It does not seem to work - ERROR messages from AA::Log are being sent to AA. Any ideas?

log4perl.logger.AA = INFO, Syncer1 log4perl.logger.AA.Log = INFO, Syncer2 log4perl.filter.MatchError = Log::Log4perl::Filter::LevelMatch log4perl.filter.MatchError.LevelToMatch = ERROR log4perl.filter.MatchError.AcceptOnMatch = true log4perl.appender.Syncer1 = Log::Dispatch:: +FileShared log4perl.appender.Syncer1.name = run.log log4perl.appender.Syncer1.filename = run.log log4perl.appender.Syncer1.layout = Log::Log4perl:: +Layout::PatternLayout log4perl.appender.Syncer1.layout.ConversionPattern = %P %d{yyyy-MM-d +d HH:mm:ss}: %m%n log4perl.appender.Syncer2 = Log::Dispatch:: +FileShared log4perl.appender.Syncer2.name = error.log log4perl.appender.Syncer2.filename = error.log log4perl.appender.Syncer2.layout = Log::Log4perl:: +Layout::PatternLayout log4perl.appender.Syncer2.layout.ConversionPattern = %m%n log4perl.appender.Syncer2.Filter = MatchError log4perl.appender.Syncer2.additivity = 0

Thanks!


In reply to Log::Log4perl additivity not working? by shamu

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.