Module for integrating Elasticsearch into Python’s signing collection.
class lumberjack.Lumberjack(hosts=None, elasticsearch=None, config=None)
Here is the initialisation point for using the lumberjack library.
Into the intended use-case, this class is instantiated when and produces handlers for usage with Python’s logging component.
Per types of sign you want to keep, you really need to offer a schema. In the event that you don’t, nothing bad may happen, however it tends to make your group instead space-inefficient automagically.
You ought to offer either a summary of Elasticsearch hosts, or an already-instantiated Elasticsearch item from elasticsearch-py.
Spawn a logging handler.
You need to use this technique to obtain a logging.Handler item to add to a logging.Logger object.
Enter a log entry schema.
It really is a smart idea to register a ‘schema’ for every single logger that you connect a handler to. It will help Elasticsearch shop the data you offer optimally.
This technique will stop before mapping is subscribed with Elasticsearch, therefore you should do it inside initialisation.
By hand trigger a flush associated with the sign queue.
This isn’t going to flush immediately; it just cancels the delay ahead of the after that flush into the ActionQueue bond.