Пример #1
0
    def emit(self, record):
        # Import the model lazily; otherwise it's imported before its AppConfig.
        from huxley.logging.models import LogEntry

        try:
            self.format(record)
            log_entry = LogEntry(level=record.levelname,
                                 message=record.message,
                                 timestamp=datetime.datetime.strptime(
                                     record.asctime, "%Y-%m-%d %H:%M:%S,%f"))
            log_entry.save()
        except:
            pass
Пример #2
0
    def emit(self, record):
        # Import the model lazily; otherwise it's imported before its AppConfig.
        from huxley.logging.models import LogEntry

        try:
            self.format(record)
            log_entry = LogEntry(
                level=record.levelname,
                message=record.message,
                timestamp=datetime.datetime.strptime(record.asctime, "%Y-%m-%d %H:%M:%S,%f"),
            )
            log_entry.save()
        except:
            pass
Пример #3
0
    def emit(self, record):
        # Import the model lazily; otherwise it's imported before its AppConfig.
        from huxley.logging.models import LogEntry

        try:
            self.format(record)
            data = json.loads(record.message)
            log_entry = LogEntry(level=record.levelname,
                                 message=data['message'],
                                 timestamp=datetime.datetime.strptime(
                                     record.asctime, "%Y-%m-%d %H:%M:%S,%f"),
                                 uri=data['uri'],
                                 status_code=data['status_code'],
                                 username=data['username'])
            log_entry.save()
        except:
            pass
Пример #4
0
    def emit(self, record):
        # Import the model lazily; otherwise it's imported before its AppConfig.
        from huxley.logging.models import LogEntry

        try:
            self.format(record)
            data = json.loads(record.message)
            log_entry = LogEntry(
                level=record.levelname,
                message=data['message'],
                timestamp=datetime.datetime.strptime(record.asctime, "%Y-%m-%d %H:%M:%S,%f"),
                uri=data['uri'],
                status_code=data['status_code'],
                username=data['username'])
            log_entry.save()
        except:
            pass