tags:

views:

72

answers:

3

what kind of logging frame work or API to use for swing applications which is used by multiple users in Unix. Is it possible to log all verbose/exception in one file per day or event one user one file per day? Since the user can open the same application with multiple instance. I also have another solution is to save the exceptions into database. But if I miss the excetpions, those will not be saved in DB.

anybody has better solutions? Thank you very much!

A: 

Saving to database seems a good idea, something like when user logs in to your swing app. Create a file in user temp directory write all his actions/exceptions etc etc into the file and when he log out read the file and save it into database.Wells there are several ways to track user actions, this is one among them.

Padur
thanks, to write a file for logging actions and exceptions. which logger api or framework I should choose. log4j? logback? what's the other ways to track users actions? could you give some reference I will research on those. thanks again!
mengmenger
A: 

You might like this article and discussion. The author mentions java.util.logging, which is discussed more extensively in this Java Logging Overview. In the context you describe, FileHandler should be able to sort out multiple instances per user without requiring a database.

trashgod
thanks a lot! I will read all the reference.
mengmenger
A: 

If you are distributing your software across a network then you have less chances of knowing each and every event user does. Not sure If log4j or any other framework helps to track every user actions in your situation. Unless if you have something running on your app server.

Well..If I were you I will do it this way.

For exceptional conditions:

  1. Come up good solid exceptional framework(something like assigning a unique Id for each exception).
  2. In case of exception condition catch it and write the full stack trace to database table with the same unique id.
  3. Come up some kind of search tool (web application) which helps you see what went wrong during user actions.

For Normal tracking I probably save user actions into table, but it hurts performance unless you come up with good framework. Not sure If I answered your questions. Please let me know if you have something to say.

-padur

Padur