Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #9 from deanq/master

Fix the KeyError on formatter
  • Loading branch information...
commit c20c817385a99f944612b533fb7c86fa553f5119 2 parents 99512c8 + 077aea2
@madzak authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/jsonlogger.py
View
4 src/jsonlogger.py
@@ -94,10 +94,10 @@ def format(self, record):
log_record = {}
for field in self._required_fields:
- log_record[field] = record.__dict__[field]
+ log_record[field] = record.__dict__.get(field)
log_record.update(extras)
merge_record_extra(record, log_record, reserved=self._skip_fields)
return json.dumps(log_record,
default=self.json_default,
- cls=self.json_encoder)
Please sign in to comment.
Something went wrong with that request. Please try again.