• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using java.util.logging.Logger and passing the assignment

 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any one used java.util.logging.Logger and passed the assignment? There are some places in the server side, I have to either dump the stacktrace of exceptions on the screen or log to a file or both. Example: main() method in the RMI server catches an Exception.
But the requirement document says "Specifically, you should document clear, simple command lines that allow your programs to be run on any Java 2 platform, regardless of the underlying hardware and operating system". Since Logger is not available prior to J2SDK1.4, I like to hear your comments. Thanks.
[ April 24, 2002: Message edited by: Sai Prasad ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sai.
Well, you might know my answer already by heart.
Actually I have been noticing quite a bit of logging in real world apps like Tomcat et al. I think they would use the Logger. I really can't see why they would take points off for it, but I am not an accessor, so I can't be too sure.
For debugging purposes it might be best for you to include it, and then remove the log when you submit.
In the case of Server startup Exception, I just pop up a message stating hey, I can't start the server. Not those exact words though
Mark
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark. I've decided to remove the logger like you said and displaying a popup message is a good idea.
 
Robin Underwood
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any feedback on this would be greatly appreciated:
I wrote a simple logger class that will log messages and exceptions to a javax.swing.text.Document, which is displayed in a gui text area. There is one Document log for the client, and another log for the server. My client gui has a tabbed pane to show the log, and the server gui has a status text area (kind of looks like Websphere App Server Admin console). It's not all implemented yet.
The client side will have popup messages, plus a client side gui log for exceptions (and maybe some other info). All server exceptions (and maybe some other info) will go to a server gui log. The server side exceptions will be rethrown so they can be caught by the client.
For the non-RMI implementation, the client log and server log will actually be the same Document object, and there will only be one log gui (the client tabbed pane).
Do you think this is good, bad, overkill?
Thanks!!
Robin
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Overkill. It won't hurt you, but it also won't give you more points, so it's up to you if you want to take the extra time.
Well I think it won't hurt you, but is Logging in the spec or requested? No.
Mark
[ May 16, 2002: Message edited by: Mark Spritzler ]
 
Robin Underwood
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the fast reply! Logging isn't in the specs, but error/exception handling is. It seems like there needs to be some place to print stack traces or show error information the user shouldn't see (i.e. criteriaFind has an invalid field name). I thought the user should only see popups with easy to understand messages such as "Server is unavailable"). How did you report exceptions?
Thanks!
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the fast reply!

That's because I always lurk in the shadows.

I thought the user should only see popups with easy to understand messages such as "Server is unavailable"). How did you report exceptions?

Actually just like that. In all but a one case, I throw my exceptions to the client, which displays a nice popup with a message like what you jsut wrote, something that they can understand.
The only exception was in my Server, if there was an error starting it up or specific to a server problem, that isn't caused by a client's call. I popped up a window with a nice message too, but on the server side. p.s. My server had a simple GUI to it.
As far as logging, you can have logging in there for you as a debugging tool, but you will want to remove it when you submit it.
Mark
[ May 16, 2002: Message edited by: Mark Spritzler ]
 
Reshma Das
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used logging and i passed the exam. i wrote my own code for logging just like Log4j. have 5 different log levels. The examineer can change the level at runtime.
I develop it my office project andi used the same code for this project. i dont think i wasted any time here by using it.
if u have to develop brand new code then i think it does not worth that much
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic