Pergunta

Eu estou planejando usar o plugin de registro de auditoria em Grails e só queria saber algo básico.
Temos que criar a classe de domínio de auditoria e persistem dados nesta tabela em vários eventos da classe de domínio, manualmente?


Quero dizer, o plugin não cria o domínio e persiste, tenho certeza. Mas seria essa a maneira padrão de salvar os dados de auditoria? Também
Se eu quiser entradas no log de auditoria como

.

"o usuário sam logado de" IP "em" Timestamp "e Usuário Atualizado George"

Eu precisaria lidar com isso no evento "onLoad" no domínio direito?

Também como eu rastrearia o evento simples como

.

"usuário Rita logou em" Timestamp ""

obrigado

Foi útil?

Solução

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.

Outras dicas

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

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