Pergunta

I'm working on a project where I'm using Symfony2 (latest) and SonataAdmin. I need to keep log of users actions by logging:

  • action/event date/time (when and at which time the user did something)
  • the user himself (the id of the user who did the action/event)
  • affected rows (which rows was affected by for example changing some data in a form)

I find in KnpBundles and over Google without success, can any give me some tips or ideas? Or if someone did this before give me some code as start point? Take in mind that I'm using SonataAdmin and this is a bit complicated.

Foi útil?

Solução

The stofDoctrineExtensions (a Symfony wrapper for Gedmo's DoctrineExtensions) Loggable extension would do this for you.

This extensions can be set to log a username, changed (create, updated & remove) and the data changed (if specified) in a table that can then be used to log and/or revert changes.

StofDoctrineExtensions (Wrapper of below)

Gedmo\DoctrineExtensions (Loggable)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top