Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`python`.`syslog`.`SyslogObserver``

class documentation

`class SyslogObserver: (source)`

View In Hierarchy

A log observer for logging to syslog.

See `twisted.python.log` for context.

This logObserver will automatically use LOG_ALERT priority for logged failures (such as from `log.err()`), but you can use any priority and facility by setting the '`syslogPriority`' and '`syslogFacility`' keys in the event dict.

Method | `__init__` | No summary
Method | `emit` | Send a message event to the syslog.

def __init__(self, prefix, options=DEFAULT_OPTIONS, facility=DEFAULT_FACILITY): (source)

Parameters
prefix:`str` | The syslog prefix to use.
options:`int` | A bitvector represented as an integer of the syslog options to use.
facility:`int` | An indication to the syslog daemon of what sort of program this is (essentially, an additional arbitrary metadata classification for messages sent to syslog by this observer).

def emit(self, eventDict): (source)

Send a message event to the syslog.

Parameters

eventDict

The event to send. If it has no `'message'` key, it will be ignored. Otherwise, if it has `'syslogPriority'` and/or `'syslogFacility'` keys, these will be used as the syslog priority and facility. If it has no `'syslogPriority'` key but a true value for the `'isError'` key, the LOG_ALERT priority will be used; if it has a false value for `'isError'`, LOG_INFO will be used. If the `'message'` key is multiline, each line will be sent to the syslog separately.