• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Leave thread details in Logging ?

 
Alan Morgan
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey all,

I am review my logging at the moment and have a question.

To help with debugging I had messages such as
"Record number 1 about to be locked with Thread XYZ".

Now I'm not sure whether it is a good idea to leave the thread details in there or not in my final submission.
On the one hand I'm thinking if there is a problem if will help when someone examines the log files.
On the other it may be overkill.

Any thoughts ?


Thanks,
Alan.
 
Ronald Wouters
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I even have a custom "java.util.logging.Formatter" implementation that creates log entries like the following


As you can see, it has a different timestamp format (up to the millisecond) and after that the thread-name. Having the thread name in a custom formatter avoids have to do a call to Thread.currentThread().getName() each time you want to include it in a log statement.
It helped me a lot debugging my locking strategy.

I am leaving it in, absolutely !

Not only to possibly help the assessor of my assignment but also to make sure I don't introduce new bugs removing the logs.

Hopes this helps.

Regards,
Ronald Wouters
[ February 02, 2006: Message edited by: Ronald Wouters ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic