定制 minvws/audit-logger-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

minvws/audit-logger-bundle

最新稳定版本:0.5.3

Composer 安装命令:

composer require minvws/audit-logger-bundle

包简介

Generic audit logger bundle for symfony

README 文档

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.

统计信息

  • 总下载量: 16.95k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 9
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: EUPL-1.2
  • 更新时间: 2025-09-01