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

def scanerrlog::ApacheErrorLog::__getdate (   self,
  line,
  match 
) [private]

Tries to get a date from a line, according to the regexp match done

Definition at line 805 of file scanerrlog.py.

00805                                          :
                """Tries to get a date from a line, according to the regexp match done"""
                if self._withdate :
                        if len(match) > 2 :
                                datebeg, dateend = match[2]
                                try :
                                        # we do a string.join(string.split(date)) because
                                        # in some cases Apache stores the day number preceded by
                                        # a space if that number is only one digit long (1st to 9th)
                                        # I saw this problem with Apache 1.3.4, RedHat SparcLinux 4.2
                                        (year, month, day, hour, minute, second, weekday, jday, dst) = time.strptime(string.join(string.split(line[datebeg:dateend])))
                                        return time.mktime((year, month, day, hour, minute, second, weekday, jday, -1))
                                except ValueError,msg :
                                        self.__stderrmessage(["ScanErrLog: %s\n" % msg, \
                                                              "date was [%s]\n" % date])

        def __append(self, numericdate, errorline) :


Generated by  Doxygen 1.6.0   Back to index