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.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Logging suggestion

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Evil is afoot. But this tiny ad is just an ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!