Использование аудита регистрации плагина в Grails

StackOverflow https://stackoverflow.com//questions/9640634

  •  10-12-2019
  •  | 
  •  

Вопрос

Я планирую использовать плагин журнала аудита в границах и просто хотел знать что-то простое.
Мы должны создать класс аудита домена и сохранять данные в эту таблицу на различных событиях из класса домена вручную вручную?
Я имею в виду плагин не создает домена и не сохраняется, я уверен .. Но это будет стандартным способом сохранения данных аудита? Также
Если я хочу записи в журнале аудита, как

"SAM SAM зарегистрирован из" IP "на" Timestamp "и обновлен пользователь Джордж"

Мне нужно будет обрабатывать его в мероприятии "onLoad" в домене правильно?

Также как бы я отслеживал простое событие, как

"Пользователь Rita вошел в систему на" Timestamp "" "

Спасибо

Это было полезно?

Решение

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.

Другие советы

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top