• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Leave thread details in Logging ?

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic