title: How can I change a log4perl appender's filters at run time?
body: <p>I'v been trying to figure out if I can change an appender's filter at run-time that I've defined via a configuration file.</p>
  
  <pre><code>log4perl.filter.M1               = Log::Log4perl::Filter::LevelMatch
  log4perl.filter.M2               = Log::Log4perl::Filter::LevelMatch
  log4perl.filter.M1.LevelToMatch  = INFO
  log4perl.filter.M1.AcceptOnMatch = true
  log4perl.filter.M2.LevelToMatch  = WARN
  log4perl.filter.M2.AcceptOnMatch = true
  log4perl.filter.MyBoolean0       = Log::Log4perl::Filter::Boolean
  log4perl.filter.MyBoolean0.logic = M1
  log4perl.filter.MyBoolean1       = Log::Log4perl::Filter::Boolean
  log4perl.filter.MyBoolean1.logic = M1 || M2
  
  log4perl.appender.SCREEN.Filter  = MyBoolean0 
  </code></pre>
  
  <p>I'd like to change this filter from <code>MyBoolean0</code> for the <code>SCREEN</code> to <code>MyBoolean1</code>, but do it after my program has started running.</p>
  
  <p>Poking at the <code>APPENDER_BY_NAME</code> hash for <code>SCREEN</code> using Data::Dumper shows the following:</p>
  
  <pre><code>$VAR1 = bless( {
       'appender' =&gt; bless( {
                              'Filter' =&gt; 'MyBoolean0',
                              'color' =&gt; {
  ...
  ...
       'filter' =&gt; bless( {·
                            'params' =&gt; {·
                                          'M3' =&gt; bless( {·
                                                           'LevelToMatch' =&gt; 'ERROR',
                                                           'name' =&gt; 'M3',
                                                           'AcceptOnMatch' =&gt; 1
                                                         }, 'Log::Log4perl::Filter::LevelMatch' ),
                                          'M1' =&gt; bless( {·
                                                           'LevelToMatch' =&gt; 'INFO',
                                                           'name' =&gt; 'M1',
                                                           'AcceptOnMatch' =&gt; 1
                                                         }, 'Log::Log4perl::Filter::LevelMatch' ),
                                          'M2' =&gt; bless( {·
                                                           'LevelToMatch' =&gt; 'WARN',
                                                           'name' =&gt; 'M2',
                                                           'AcceptOnMatch' =&gt; 1
                                                         }, 'Log::Log4perl::Filter::LevelMatch' )
                                        },
                            'name' =&gt; 'MyBoolean0',
                            'eval_func' =&gt; sub { "DUMMY" },
                            'logic' =&gt; 'M1 || M2 || M3'
                          }, 'Log::Log4perl::Filter::Boolean' ),
       'warp_message' =&gt; undef,
       'name' =&gt; 'SCREEN'
     }, 'Log::Log4perl::Appender' );
  </code></pre>
  
  <p>But mucking with this HASH seems hackish to me. Is there a better way to change an appender's filters?</p>