Skip to content

CTalkingO/SymfonyLogEvent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SymfonyLogEvent

SymfonyLogEvents is a Central Management entity CURD loggable tool. No Taint, no entity code injection, no any dependency injection and it support many-to-many loggable. It can log all registered entity's CURD logs use doctrine LifeCycle Events.

  1. This Symfony LogEvent, the code reference the knpLab's DoctrineBehaviors.
  2. This Symfony LogEvent auto logs times, timestampable, use Gedmo. You can change it into manual.

###How to use:###

  1. Change OpLog.orm.yml, add your own entity fields.

  2. Run doctrine command: $ php app/console generate:doctrine:entity --entity=YourBundle:OpLog

  3. Add a event services:

    app.doctrine_brochure_listener:
    	class: Ace\YourBundle\EventListener\LogEventListener
    	arguments: ['@service_container' , '@security.token_storage' , '@service_container' ]
    
    	tags:
    	    - { name: doctrine.event_listener, event: postUpdate }
    	    - { name: doctrine.event_listener, event: postPersist }
    	    - { name: doctrine.event_listener, event: preRemove }
    
  4. Modify LogEventListener.php, add your own fields and logic,

    a. Modify $this->entityCollection, add your own class in LogEventListener.php:

    	$this->entityCollection = array(
    	    //YourBundle::class
    	);
    

    b. Modify OperationLogging mothed add your own entity fields in LogEventListener.php :

        $array = [
    		"event" => $event ,
    		"ip" => $ip,
    		"operatedBy" => $OperatedBy,
    		"operatedAt" => $date,
    		"element" => $element ,
    
        ];
    
  5. Finish and enjoy it.

About

Symfony Log Events by LifeCycle

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages