Domanda

Sto pensando di utilizzare il plug-in di registrazione dell'audit in Graal e volevo solo sapere qualcosa di base.
Dobbiamo creare la classe di dominio di audit e persistere i dati in questa tabella su vari eventi dalla classe di dominio manualmente?
. Voglio dire che il plugin non crea il dominio e persistono sono sicuro ... ma sarebbe il modo standard per salvare i dati di audit? Anche
. Se voglio voci nel registro di audit come

.

"User Sam ha effettuato l'accesso da" IP "su" Timestamp "e aggiornato dall'utente George"

Dovrei gestirlo nell'evento "onLoad" nel dominio giusto?

Anche come vorrei monitorare il semplice evento come

.

"Utente RITA registrato su" Timestamp ""

Grazie

È stato utile?

Soluzione

The audit logging plugin is much more automated than it appears you think. The plugin does indeed have its own domain class and does save all the audit information for you, without you having to do anything other than adding 'auditable=true' to your domain class that you want audited!

As to the second part of your question, if sam updated george, the update to the fields on 'george' would be audited (assuming you added auditable=true to the domain class that george is), and the fact that sam did it would be captured by the 'actor' information depending on what security framework you're using (this is documented in the plugin).

Your desire to log timestamp and IP upon login may fall outside the audit logging plugin, unless there is a specific change to a domain class that you can capture when someone logs in.

Altri suggerimenti

The 0.5+ version, 13 October 2010, includes the ability to specify an actorClosure in Config.groovy. The documentation at the link below has examples of how to get user information using several different security plugins.

http://grails.org/plugin/audit-logging

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top