Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 640 Bytes

custom-logger.md

File metadata and controls

33 lines (24 loc) · 640 Bytes

Custom Logger

You could easily create your own logger suitable to your needs. The Change Required to use your Logger is very simple. Just follow the steps:

1. Write Your LoggerClass

<?php
//src/Logger/CustomLogger.php

namespace  App\Logger;

use Xiidea\EasyAuditBundle\Logger\LoggerInterface;
use Xiidea\EasyAuditBundle\Model\BaseAuditLog as AuditLog;

class CustomLogger implements LoggerInterface
{

    public function log(AuditLog $event)
    {
        //...
    }
}

2. Define your Logger as service

services:
     class: App\Logger\CustomLogger
     tags:
          - { name: easy_audit.logger }