File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes logging status messages into a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "logging status messages into a file" Watch "logging status messages into a file" New topic

logging status messages into a file

Rasika Chitnis
Ranch Hand

Joined: Jun 19, 2001
Posts: 131
Is anybody logging debug messages or exceptions to a log file ? I know it is not a requirement, but I had lot of System.out's in debug phase and I feel some of them should be retained even in the final version, e.g. when I run the server I would have liked to see a message on the console confirmimg that the object is successfully bound in the rmiregistry.
Rasika Chitnis
Ranch Hand

Joined: Jun 19, 2001
Posts: 131
Is retaining System.out's in the code, a total NO-NO for this project ?? I find that in some places, it makes absolute sense to print status to console, like unlock method could not unlock the record, as a quick way to tell that something went wrong.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

You don't want System.outs in your code for submission. Usually your exceptions should be chained up to you GUI, where you can display a nice message saying things like "Unable to Unlock Record, you don't have the Lock" or something like that.
Personnally if I am running the app, which I am submitting, I don't want to see the console pop some message on the screen, as that scares me, usually It means to me an excepetion has occured.
But System.outs are very important for debugging.

Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: logging status messages into a file
jQuery in Action, 3rd edition