def _check_rotated_filename_candidates(self):
<EOL>candidate = "<STR_LIT>" % self.filename<EOL>if (exists(candidate) and exists("<STR_LIT>" % self.filename) and<EOL>(stat(candidate).st_mtime > stat("<STR_LIT>" % self.filename).st_mtime)):<EOL><INDENT>return candidate<EOL><DEDENT>candidate = "<STR_LIT>" % self.filename<EOL>if exists(candidate):<EOL><INDENT>return candidate<EOL><DEDENT>candidate = "<STR_LIT>" % self.filename<EOL>if exists(candidate):<EOL><INDENT>return candidate<EOL><DEDENT>rotated_filename_patterns = [<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>]<EOL>if self.log_patterns:<EOL><INDENT>rotated_filename_patterns.extend(self.log_patterns)<EOL><DEDENT>file_dir, rel_filename = os.path.split(self.filename)<EOL>for rotated_filename_pattern in rotated_filename_patterns:<EOL><INDENT>candidates = glob.glob(os.path.join(file_dir, rotated_filename_pattern % rel_filename))<EOL>if candidates:<EOL><INDENT>candidates.sort()<EOL>return candidates[-<NUM_LIT:1>]  <EOL><DEDENT><DEDENT>return None<EOL>
Check for various rotated logfile filename patterns and return the first
match we find.