私は、監査ログプラグインでgrails 1.3.7を使用しています。私はログに "user:PSam logged in at ..."のようなユーザーログインイベントをキャプチャしたい、プラグインにはonLoad
イベントが定義されていないので、ドメインクラスに追加して、このイベントで自分の監査テーブルエントリを設定します。 )それを2 nullとして来ている私はここに二つの問題が生じていますユーザーログインの監査ログエントリを挿入する
def onLoad = {
try {
Graaudit aInstance = new Graaudit();
aInstance.eventType= "User Log in"
aInstance.eventDescription = "User logged in"
aInstance.user_id = username
aInstance.save(flush:true);
println "username="+username
println aInstance;
}
catch (e){
println(e.getMessage())
}
}
... 1)属性としてこのドメインクラスで定義されたユーザ名のプロパティを次のように だからGrailsのユーザードメインクラスで私がやります次のような例外がスローされます。No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
もう1つのアプローチはありますか? また、プラグインのaudi_logテーブルを使用して、onLoad()イベントの入力を設定できますか?事前に
おかげ取引で
どうもありがとう、... –