@@ -200,6 +200,9 @@ file will automatically rotate.
200
200
Note that setting <<config-log_level>> is required for this setting to do
201
201
anything.
202
202
203
+ If https://github.com/elastic/ecs-logging-python[`ecs_logging`] is installed,
204
+ the logs will automatically be formatted as ecs-compatible json.
205
+
203
206
[float]
204
207
[[config-log_file_size]]
205
208
==== `log_file_size`
@@ -215,6 +218,36 @@ The size of the log file, if <<config-log_file>> is set.
215
218
The agent always keeps one backup file when rotating, so the max space that
216
219
the log files will consume is twice the value of this setting.
217
220
221
+ [float]
222
+ [[config-auto_ecs_logging]]
223
+ ==== `auto_ecs_logging`
224
+
225
+ [options="header"]
226
+ |============
227
+ | Environment | Django/Flask | Default
228
+ | `ELASTIC_APM_AUTO_ECS_LOGGING` | `AUTO_ECS_LOGGING` | `False`
229
+ |============
230
+
231
+ If https://github.com/elastic/ecs-logging-python[`ecs_logging`] is installed,
232
+ setting this to `True` will cause the agent to automatically attempt to enable
233
+ ecs-formatted logging.
234
+
235
+ For base `logging` from the standard library, the agent will get the root
236
+ logger, find any attached handlers, and for each, set the formatter to
237
+ `ecs_logging.StdlibFormatter()`.
238
+
239
+ If `structlog` is installed, the agent will override any configured processors
240
+ with `ecs_logging.StructlogFormatter()`.
241
+
242
+ Note that this is a very blunt instrument that could have unintended side effects.
243
+ If problems arise, please apply these formatters manually and leave this setting
244
+ as `False`. See the
245
+ https://www.elastic.co/guide/en/ecs-logging/python/current/installation.html[`ecs_logging` docs]
246
+ for more information about using these formatters.
247
+
248
+ Also note that this setting does not facilitate shipping logs to Elasticsearch.
249
+ We recommend https://www.elastic.co/beats/filebeat[Filebeat] for that purpose.
250
+
218
251
[float]
219
252
[[other-options]]
220
253
=== Other options
0 commit comments