This week's book giveaway is in the Reactive Progamming forum. We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line! See this thread for details.
hi, I am asking this again since I did not get a response the last time. So please if you can suggest/respond to this I will greately appreciate it.
Basically, I am using jakarta struts to develop a small project. I am trying to see how I can log the activities of all users who log in to the application and access the database (creating, deleting and editing data) etc. I want to be able to record these information so that I know who logged in when, what the activity of that user was. Now, I have and am still reading on some mechanisms such as the log4j etc. But I am still not sure of what tool to use to accomplish this. If I am to use the log4j do I use the logger.info for inserting such info or what? Can any one suggest to me what tool to use so that I start reading and working on it. Also if anyone know where I can get more resources regarding this (such as examples) can you please tell me. Thank you in advance for your help. Lee
log4j will generate text/log files that you will have to use some sort of utilities to parse out the information you are after per user. there may be utilities out there that may allow you to set up log4j in a certain structure that allows for easy reporting.
if you want to audit user activities and write useful reports easier, i'd go with a simple database table. it seems you already have the user login information, all you do is have an common method to insert a line into something like a USER_ACTIVITIES table using the user login id as one of the lookup columns. before and/or after an activity, simply call the method to insert an activity code and/or description.
now, you mentioned a small app so logging using the database may be OK. if it's a huge app, performance may be an issue.
-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>