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.
- PHP >= 8.1
- Composer
- Symfony >= 6.3
Install the package through composer:
$ composer require minvws/audit-logger-bundle
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:
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) |
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) |
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) |
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) |
See minvws/audit-logger for more information.
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';
}
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.
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.
This package is part of the iCore project.