• Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating LogFile  RSS feed

 
vin Hari
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
Iam developing a program for client-server environment, here the application is menu driven and created using awt swings,know my question is i want to create a logfile which keep a record of user who is connecting with the server what are applications he is using all should be maintained
and also at what time he disconnected with server also should be mentioned so where to keep the logfile is it on serverside or client side and how to write on that please help ,thanks in advance.
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I saw a Log class somewhere in the sources.

If you want, I will go find it for you.

Most definitely, use this as the rest of Java will likely integrate with it, especially the servers.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The java.util.logging class has the library classes. Apache commons Log4J is also popular.

After using other libraries, I've just started using Log4J and it seems to be working out ok. I've never been a fan of controlling logging by severity level, and preferred to control it by class or method or arbitrary word-match flags. I'll just have to get used to this now. Sigh.
 
Paul Clapham
Sheriff
Posts: 22844
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by vin Hari:
where to keep the logfile is it on serverside or client side
If you kept the log file on the client side, then each user would have their own log file that told them when they connected and disconnected. You would not be able to access that from the server.

I don't know if that is what you want because you didn't say what the logging was for. I suspect it is not what you want, but you will surely know.
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Stan James:]   I've never been a fan of controlling logging by severity level, ...(snip)... I'll just have to get used to this now. Sigh.

Yes, you go into a tight-loop condition often characterized by the words: "Except if the exception is an exceptional exception." I have a degreed Industrial Engineer on my team and he seemed to fluently recognize the design weakness, so show them no mercy. Steadfast my friend. I have never been wavering with you, have I ?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I missed that bit about client side logs. I've been through that, too. If your client will run disconnected, it has to keep its own local logs. Try to keep the log very quiet - only show real errors and things that are useful, not every keystroke or data fetch. We gave the users an easy way to turn on debug info when necessary. They were captive corporate users so we could train them or have supervisors walk over to help. Not a good approach in the public internet world. We considered a client feature to e-mail the log but never got around to it. Some kind of one-button "send the help desk everything that might be interesting" after a crash would be neat.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!