Download the PHP package aubes/shadow-logger-bundle without Composer
On this page you can find all versions of the php package aubes/shadow-logger-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package shadow-logger-bundle
Shadow Logger Bundle
This Symfony bundle provides a monolog processor to transform log data, in order to respect GDPR or to anonymize sensitive data.
It allows Ip anonymization, encoding or removing data in the log.
Installation
Configuration
The configuration looks as follows :
Mapping
Field name could contain dot to dive into array.
For example, if 'extra' contains the array :
It is possible to modify ip
and name
fields :
Warning, it is better to use field name without dot for performance. Internally, when a field name contains a dot the PropertyAccessor is used instead of a simple array key access.
Transformer
Currently, this bundle provides these transformers :
- ip: Anonymize IP v4 or v6 (cf:
Symfony\Component\HttpFoundation\IpUtils::anonymize
) - hash: Encode the value using hash function
- string: Cast a
scalar
intostring
or call__toString
on object - remove: Remove value (replaced by
--obfuscated--
) - encrypt: Encrypt the value (available only if encryptor is configured, cf: Encrypt transformer)
Chain transformers
You can chain transformers, for example to encode a "Stringable" object :
Hash transformer
Encoder configuration :
Encrypt transformer
The bundle does not provide an encryption class.
To use the "encrypt" transformer, you need to manually configure the encryptor.
First, you need to create an Adapter class and extends EncryptorInterface :
Next, register your class as a service (if service discovery is not used):
Finally, configure your service Id in the ShadowLoggerBundle :
This transformer replaces the value with an array :
Custom transformer
First you need to create a Transformer class and extends TransformerInterface :
Next, register your class as a service with 'shadow_logger.transformer' tag :
All versions of shadow-logger-bundle with dependencies
monolog/monolog Version ^2.0 | ^3.0
symfony/polyfill-php80 Version ^1.0
symfony/http-foundation Version ^5.4 |^6.0
symfony/http-kernel Version ^5.4 |^6.0
symfony/property-access Version ^5.4 | ^6.0