twisted.logger.jsonFileLogObserver(outFile, recordSeparator=u'\x1e')
function documentationtwisted.logger
View Source
Create a FileLogObserver
that emits JSON-serialized events to a specified (writable) file-like object.
Events are written in the following form:
RS + JSON + NL
JSON
is the serialized event, which is JSON text. NL
is a newline (u"\n"
). RS
is a record separator. By default, this is a single RS character (u"\x1e"
), which makes the default output conform to the IETF draft document "draft-ietf-json-text-sequence-13".
Parameters | outFile | A file-like object. Ideally one should be passed which accepts unicode data. Otherwise, UTF-8 bytes will be used. (type: io.IOBase ) |
recordSeparator | The record separator to use. (type: unicode ) | |
Returns | A file log observer. (type: FileLogObserver ) |