Logo Search packages:      
Sourcecode: fail2ban version File versions  Download package

def logreader::logreader::LogReader::setFilePos (   self,
  file 
)

Sets the file position. We must take care of log file rotation
      and reset the position to 0 in that case. Use the log message
      timestamp in order to detect this.		

Definition at line 110 of file logreader.py.

00110                                 :
            """ Sets the file position. We must take care of log file rotation
                  and reset the position to 0 in that case. Use the log message
                  timestamp in order to detect this.        
            """
            line = file.readline()
            if self.lastDate < self.getTime(line):
                  logSys.debug("Date " + `self.lastDate` + " is " + "smaller than " +
                                          `self.getTime(line)`)
                  logSys.debug("Log rotation detected for " + self.logPath)
                  self.lastPos = 0
            
            logSys.debug("Setting file position to " + `self.lastPos` + " for " +
                                    self.logPath)
            file.seek(self.lastPos)
      
      def getFailures(self):


Generated by  Doxygen 1.6.0   Back to index