twin-elements/crud-logger

Crud logger for CMS

v1.0.1 2022-07-29 11:10 UTC

This package is auto-updated.

Last update: 2024-10-29 06:46:57 UTC


README

##Installation composer require twin-elements/crud-logger

in services add

<service id="TwinElements\Component\CrudLogger\CrudLogger">
    <argument id="security.token_storage"/>
    <argument id="logger"/>
    <tag name="monolog.logger" channel="crud"/>
</service>

<service id="TwinElements\Component\CrudLogger\CrudLoggerInterface" alias="TwinElements\Component\CrudLogger\CrudLogger"/>

in config

monolog:
    channels: ['crud']
    handlers:
        crud:
            type: stream
            level: info
            path: '%kernel.logs_dir%/crud.log'
            channels: ['crud']

###Usage

$this->crudLogger->createLog(Entity::class, CrudLogger::CreateAction, ID);