You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi - firstly thanks for creating this log handler, it's simplified things for me greatly.
however I'm unable to get things to work as described in the doco.; the example json formatter just won't work, and cannot produce the results described in the documentation. I've tried to modify it myself but I cannot find a way to make the log formatter correctly handle dictionaries passed to it, and the resulting message sent to CW is not valid json (contains ' instead of ") and is parsed as a string only.
This is a problem for me as well. I think the specific problem is lack of support for nested JSON objects. If this is supported, what is the magic incantation? If it's not, can it be added?
Thank you for your interest in Watchtower. If you want to log JSON, do not use a formatter that formats your message as a non-JSON string.
I agree the documentation of the logging system YAML config was misleading. It was originally contributed by a third party and I failed to thoroughly vet it. I deleted all mention of formatters from that part of the documentation.
To be clear, JSON and nested JSON objects are supported and have been supported by Watchtower since day one, as illustrated in line 6 of the first code block in the readme.
Hi - firstly thanks for creating this log handler, it's simplified things for me greatly.
however I'm unable to get things to work as described in the doco.; the example json formatter just won't work, and cannot produce the results described in the documentation. I've tried to modify it myself but I cannot find a way to make the log formatter correctly handle dictionaries passed to it, and the resulting message sent to CW is not valid json (contains ' instead of ") and is parsed as a string only.
e.g. my formatter attempt
format: '{ "timestamp" : "%(asctime)s", "process" : "%(process)d", "levelname" : "%(levelname)s", "name" : "%(name)s", "function" : "%(funcName)s", "line" : "%(lineno)s", "message" : "%(message)s" }'
and the resulting message sent to CW
can you please advise what the json formatter should be in the logging config?
best
Richard
cwtest.py.txt
The text was updated successfully, but these errors were encountered: