-
Notifications
You must be signed in to change notification settings - Fork 61
Closed
Description
In python 3 with configparser i get the following error when trying to log a message:
Traceback (most recent call last):
File "/usr/lib/python3.5/logging/__init__.py", line 980, in emit
msg = self.format(record)
File "/usr/lib/python3.5/logging/__init__.py", line 830, in format
return fmt.format(record)
File "/home/mafm/pycharm-35venv/lib/python3.5/site-packages/logstash_formatter-0.5.15-py3.5.egg/logstash_formatter/__init__.py", line 172, in format
return json.dumps(logr, default=self.json_default, cls=self.json_cls)
File "/usr/lib/python3.5/json/__init__.py", line 237, in dumps
**kw).encode(obj)
TypeError: 'str' object is not callable
It seems that _create_formatters in config.py of 'logging' will add a third argument (style) when initializing logstash formatter. This puts a string ("%") in stead of the json_cls.
Might be a new behaviour of "logging"?
Maybe the fix is as simple as changing the constructor function (init) to
def __init__(self,
fmt=None,
datefmt=None,
style=None,
json_cls=None,
json_default=_default_json_default):
?
miszczu
Metadata
Metadata
Assignees
Labels
No labels