Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

logging status messages into a file

 
Rasika Chitnis
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic