Skip to content

Commit f7bac0e

Browse files
clarify that our log handlers shouldn't be used for "normal" log shipping (#605)
Co-Authored-By: Brandon Morelli <[email protected]>
1 parent e5a2e11 commit f7bac0e

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

docs/django.asciidoc

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff 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

200206
An example of how your `LOGGING` setting could look:
201207

docs/flask.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ apm = ElasticAPM(app, logging=True)
158158

159159
NOTE: using `logging=True` can lead to high number of logs being sent to Elastic APM.
160160
We 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

162163
For fine-grained control, you can initialize a logging handler and add it,
163164
just as you would with any other handler.

0 commit comments

Comments
 (0)