• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Audit trail logging

 
André Campanini
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I use JSF in my web apps.

I was looking for information about the best way to implement "Audit trail logging", and it's so hard to find information about it. So I found this Jesper Young's explanation and I liked it very much:

http://www.coderanch.com/t/384320/java/java/Log-debug-Log-Info-Log

I want to trail user's activities in a web app and register them in a database for a period of time.

So, I want to be sure about which way I have to implement this, and Jesper wrote a little about exactly what I'm looking for.

I also found some more information, but it didn't help me a lot:

http://forums.sun.com/thread.jspa?messageID=10331111
http://www.codesecurely.org/Wiki/view.aspx/Security_Code_Reviews/Logging__Auditing#Auditing

Any help about how to implement "Audit trail logging"?

Regards,
[ October 02, 2008: Message edited by: Andr� Campanini ]
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

In that other thread I wrote that we implemented audit trail logging by writing log messages into a database.

What we did is not very complicated: there's one table with just a few columns (a timestamp, a varchar for the message, etc.) and we simply use JDBC to insert a new row into the table when an audit log message has to be stored.
 
Rob Spoor
Sheriff
Pie
Posts: 20369
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not too hard to write a database appender yourself. You just need to implement / override a few methods:

Now append cannot throw SQLException, so should one occur you can handle it as follows:
 
André Campanini
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excellent! I'll work on it!

Thanks a lot!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic