File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -191,11 +191,17 @@ ELASTIC_APM = {
191191
192192[float]
193193[[django-logging]]
194- === Logging
194+ === Integrating with Python logging
195195
196- For fine-grained control over logging use Python's built-in logging module.
197- If you are new to how the logging module works together with Django, read more
198- https://docs.djangoproject.com/en/1.7/topics/logging/[in the Django documentation].
196+ To easily send Python `logging` messages as "error" objects to Elasticsearch,
197+ we provide a `LoggingHandler` which you can use in your logging setup.
198+ The log messages will be enriched with a stack trace, data from the request, and more.
199+
200+ NOTE: the intended use case for this handler is to send high priority log messages (e.g. log messages with level `ERROR`)
201+ to Elasticsearch. For normal log shipping, we recommend using {filebeat-ref}[filebeat].
202+
203+ If you are new to how the `logging` module works together with Django, read more
204+ https://docs.djangoproject.com/en/2.1/topics/logging/[in the Django documentation].
199205
200206An example of how your `LOGGING` setting could look:
201207
Original file line number Diff line number Diff line change @@ -158,6 +158,7 @@ apm = ElasticAPM(app, logging=True)
158158
159159NOTE: using `logging=True` can lead to high number of logs being sent to Elastic APM.
160160We recommend to always limit logging with Elastic APM to a high level (`WARNING` or `ERROR`).
161+ For shipping of less urgent logs, we recommend to use {filebeat-ref}[filebeat].
161162
162163For fine-grained control, you can initialize a logging handler and add it,
163164just as you would with any other handler.
You can’t perform that action at this time.
0 commit comments