@@ -228,6 +228,8 @@ def load_config_file(configuration_file=None, expand=True):
228228 # 'timestamp-pattern' configuration file option has a value set.
229229 if items .get ('timestamp-pattern' ):
230230 options ['timestamp_pattern' ] = items ['timestamp-pattern' ]
231+ if items .get ('stat-timestamp' ):
232+ options ['stat_timestamp' ] = items ['stat-timestamp' ]
231233 # Expand filename patterns?
232234 if expand and location .have_wildcards :
233235 logger .verbose ("Expanding filename pattern %s on %s .." , location .directory , location .context )
@@ -404,9 +406,6 @@ def __init__(self, rotation_scheme, **options):
404406 """
405407 options .update (rotation_scheme = rotation_scheme )
406408 super (RotateBackups , self ).__init__ (** options )
407- if self .stat_timestamp :
408- logger .info ("Using file mtime to determine file date" )
409- self .matcher = FilestatMatcher ()
410409
411410 @mutable_property
412411 def config_file (self ):
@@ -550,6 +549,15 @@ def rotation_scheme(self):
550549 @mutable_property
551550 def stat_timestamp (self ):
552551 """Whether to use the files' mtime instead of parsing their name."""
552+ return isinstance (self .match , FilestatMatcher )
553+
554+ @stat_timestamp .setter
555+ def stat_timestamp (self , value ):
556+ if value :
557+ logger .info ("Using file mtime to determine file date" )
558+ self .matcher = FilestatMatcher ()
559+ elif isinstance (self .match , FilestatMatcher ):
560+ del self .matcher
553561
554562 @mutable_property
555563 def strict (self ):
0 commit comments