Treblle with Symfony
Requirements
- PHP 7.4+
- Symfony 4.4+
Installation
To install the SDK you will need to be using Composer in your project. To install it please see the docs.
Enable the Bundle
Enable it by adding it to the list of registered bundles depending on the Symfony version you’re using.
Configuration of the SDK
Configure the SDK by adding the following snippet to your project configuration. If you have Symfony 3.4 add it
to app/config/config_prod.yml
. For Symfony 4 or newer add the value to config/packages/treblle.yaml
.
Overriding data providers
Treblle SDK allows you to take over control over how the data is collected, processed, and sent to the Trebble service.
By default, the SDK will take all values from the masked
configuration key and combine it with well-known keys such as
password
or ssn
to compile a list of sensitive information. These values will never be sent in a plain text, but
rather will be masked.
Default service configuration for Treblle looks like this:
If you want to replace any component, feel free to provide your own implementation and register it in the DI container. When you alias the interface to point to your implementation instead of the default one, Treblle will use it.
Example: We want to override how Request data is collected and passed to Treblle
- We implement our own service satisfying the
Treblle\Contract\RequestDataProvider
interface inApp\Utils\AcmeRequestDataProvider
- We register the service in our own
services.yaml
:
- We define service alias:
Treblle\Contract\RequestDataProvider: '@AcmeRequestDataProvider'
Now all instances depending on the RequestDataProvider
interface will use your service.