承接 tbaronnat/log-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

tbaronnat/log-bundle

最新稳定版本:v1.0.3

Composer 安装命令:

composer require tbaronnat/log-bundle

包简介

Simple log bundle system with Symfony integration

README 文档

README

How to use
  • Add LoggableInterface to each entity you want to log
  • Create your own instance of LogManager, extending LogManager or AbstractLogManager of this bundle if needed to add more data to LogObject, or to configure another way to exclude fields if you want
  • Create your own Log.php Entity who extends of AbstractLog and implements LogInterface
  • Create a Repository associated to your entity, and put LogRepositoryTrait inside, or use LogRepository on this file
  • Your current User class should implements LogCreatorInterface
  • Display logs:
Excluded fields annotation

Use Doctrine annotation @LogExcludedField to exclude a specific field to log in your entity

    /**
     * @LogExcludedField()
     * @ORM\Column(name="excluded_field", type="string", length=255, nullable=true)
     */
    protected ?string $excludedField = null;
Exemples:

Display all logs depending on specifics classes, for one user.

    {% include '@TBaronnatLog/logs/_display_classes_user_log.html.twig' with {
        'classes': ['App\\Entity\\User', 'App\\Entity\\Documents'],
        'user': resource.user
    } %}
    {% if resource is not null and resource.id is not null %}
        {% include '@TBaronnatLog/logs/_display_resource_log.html.twig' with {
            'resource': resource
        } %}
    {% endif %}
    {% include '@TBaronnatLog/logs/_display_resources_log.html.twig' with {
        'resources':  resources,
        'logClasses': ['App\\Entity\\Documents']
    } %}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-05