From 44029cb8f0d40debca9856e54dbb11fac1c9bf8d Mon Sep 17 00:00:00 2001 From: "Frank de Graaf (Phally)" Date: Thu, 28 May 2020 23:16:35 +0200 Subject: [PATCH] Adds docs for ApiQueryLogListener connections config. --- docs/listeners/api-query-log.rst | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/listeners/api-query-log.rst b/docs/listeners/api-query-log.rst index b58614f73..8426477b1 100644 --- a/docs/listeners/api-query-log.rst +++ b/docs/listeners/api-query-log.rst @@ -29,7 +29,7 @@ you want to attach it only to specific controllers and actions } -Attach it using components array, this is recommended if you want to +Attach it in :code:`AppController::initialize()`, this is recommended if you want to attach it to all controllers, application wide @@ -88,3 +88,23 @@ Paginated results will include a } } } + + +Configuration +------------- + +By default this listener will log all defined connections. + +If you need to select specific connections to log, you can use the :code:`connections` configuration: + +.. code-block:: php + + $this->loadComponent('Crud.Crud', [ + 'listeners' => [ + 'Crud.Api', + 'ApiQueryLog' => [ + 'className' => 'Crud.ApiQueryLog', + 'connections' => ['default', 'elastic'] + ] + ] + ]);