minvws / audit-logger-bundle
Generic audit logger bundle for symfony
Installs: 476
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 9
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.1
- doctrine/doctrine-bundle: ^2.11
- doctrine/orm: ^2.0 | ^3.0
- minvws/audit-logger: ^0.4.0
- nesbot/carbon: ^2.70 | ^3.0
- symfony/dependency-injection: ^6.3 | ^7.0
- symfony/http-kernel: ^6.3 | ^7.0
- symfony/uid: ^6.3 | ^7.0
Requires (Dev)
- dg/bypass-finals: ^1.6
- mockery/mockery: ^1.6.7
- overtrue/phplint: ^5.5 | ^9.1
- php-amqplib/rabbitmq-bundle: ^2.14
- phpstan/phpstan: ^1.10
- phpstan/phpstan-doctrine: ^1.3
- phpstan/phpstan-mockery: ^1.1
- phpstan/phpstan-strict-rules: ^1.5
- phpstan/phpstan-symfony: ^1.3
- phpunit/phpunit: ^10.2
- slevomat/coding-standard: ^8.14
- squizlabs/php_codesniffer: ^3.8
- symfony/var-dumper: ^6.0 | ^7.0
Suggests
- doctrine/orm: To use the doctrine audit logger
- php-amqplib/rabbitmq-bundle: To use the rabbitmq audit logger
This package is not auto-updated.
Last update: 2025-09-02 13:24:44 UTC
README
This package extends the minvws/audit-logger package and provides a generic logging service for Symfony applications for the RDO platform. It allows to easily log events to the database, syslog or other destinations.
Prerequisites
- PHP >= 8.1
- Composer
- Symfony >= 6.3
Installation
Composer
Install the package through composer:
$ composer require minvws/audit-logger-bundle
Configuration
The package can be configured in the audit_logger.yaml
file. There is a generic configuration for encryption:
public_key: # The public key to use for encryption private_key: # The private key to use for encryption
There are currently four logging destinations available: psr, database, file and rabbitmq:
PSR-3 Logger (psr_logger)
Generic PSR-3 logger that can be used to log to any PSR-3 compatible logger.
Possible configuration options:
Option | Value type | Default | Description |
---|---|---|---|
enabled | boolean | true | Enable logging |
encrypted | boolean | true | Encrypt the log data |
log_pii | boolean | true | Log Personal Identifiable Information (PII) |
Database Logger (doctrine_logger)
Log data to the database.
Possible configuration options:
Option | Value type | Default | Description |
---|---|---|---|
enabled | boolean | true | Enable logging |
encrypted | boolean | true | Encrypt the log data |
log_pii | boolean | true | Log Personal Identifiable Information (PII) |
File Logger (file_logger)
Log data to the database.
Possible configuration options:
Option | Value type | Default | Description |
---|---|---|---|
enabled | boolean | true | Enable logging |
path | string | '%kernel.logs_dir%/audit.log' | Path to where log file is written |
encrypted | boolean | true | Encrypt the log data |
log_pii | boolean | true | Log Personal Identifiable Information (PII) |
RabbitMQ Logger (rabbitmg_logger)
Log data to RabbitMQ.
Possible configuration options:
Option | Value type | Default | Description |
---|---|---|---|
enabled | boolean | true | Enable logging |
additional_events | array | [] | Register additional event to publish |
routing_key | string | '' | Optional routing key |
log_pii | boolean | true | Log Personal Identifiable Information (PII) |
More information
See minvws/audit-logger for more information.
Creating custom events
Creating a custom event is easy. You can create a new class that extends the MinVWS\AuditLogger\Events\Logging\GeneralLogEvent
class.
use MinVWS\AuditLogger\Events\Logging\GeneralLogEvent; class MyCustomEvent extends GeneralLogEvent { public const EVENT_CODE = '991414'; public const EVENT_KEY = 'my_custom_event'; }
Contributing
If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on the GitHub repository of this package.
License
This package is open-source and released under the European Union Public License version 1.2. You are free to use, modify and distribute the package in accordance with the terms of the license.
Part of iCore
This package is part of the iCore project.