Skip to content

Commit

Permalink
Adds docs for ApiQueryLogListener connections config.
Browse files Browse the repository at this point in the history
  • Loading branch information
Phally committed May 28, 2020
1 parent 1117ed9 commit 44029cb
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion docs/listeners/api-query-log.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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']
]
]
]);

0 comments on commit 44029cb

Please sign in to comment.