I would need to implement an audit log for a web application written with JBoss Seam. EntityListeners seem like good candidates, but I don't know how to connect the EntityListeners to the application session context to include the logged in used principal in the audit record.
I wonder if there is a way to do this "connection", or if there is a more confortable/elegant/effective way to implement an audit log for this programming environment.
Thanks in advance.
Rafa.
Edit:
Many thanks to Damo for his answer! I tried the injection of my identity component, but it did not work. However, the suggested call to Component.getInstance() did provide the desired reference to the user's identity in the EntityListener.