• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Logging ?

 
steve mcdonald
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I am not implementing any logging to the file. If in unhandled, catastrophic situations i just do a stdout, stderr. that's all

Am i fine getting away with out using logging API ?

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

I would highly recommend using the logging API for a number of reasons:

1. When you are working on your locking it is invaluable to see what is happening and when. Using standard output here will not work as the messages will not appear in the correct time order.

2. Maintainability is a requirement and a lack of logging could be seen as adversely affecting this.

3. Its not that bad

Have a look at this http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/overview.html

It starts to get a little more complicated after a while.
For example if system breaks and a Tech comes along and wants to see all the messages logged on the server side how will he do this ?
Or what if he just wants to see severe log entries ?

This means we have to allow a means of configuring our logging options.
But hwo to do this ?
Put something on the UI for it ? But most users won't care.

These are some of the things I am struggling with at the moment.
So if anyone reading this can help - feel free to suggest


Thanks,
Alan.
 
steve mcdonald
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alan,

It is a good thing, not mandatory per instructions.

It may get little complicated with several options to choose.
such as
1. do i implement centralized logging for entire application to one file ?
2. do i have separate files per mode ? GUI/NetWork/Database etc
3. what levels to choose, debug/ info / warning / error etc.,

As there is no specification requirement in the instructions, i am planning not to do.

Most of the messages (implemented via ListResourceBundle, parameterized, meaning dynamic messages formatted at runtime with replaceable parameter placeholder) i am handling properly by reporting to the user with actual possible handled recoverable situations. All unhandled situations goes to the stdout/stderr.

Already i spent way too much time on this and want to put an end to it.

Re-reading the instructions get's me thinking into more complex problems and issues that i may have to code to handle as real application scenarios.

So i think i just put an end to some things that ought to be done and not necessarily nice to have.

Any comments/suggestions please

Andrew may have some insight on this

Thanks ya all for the excellent responses
- Steve
 
Daniel Dalton
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hiya - in the real world, logging's great - go for it. However, for the assignment, how are you going to configure it? Bear in mind that you're not allowed to require the examiner to edit any files manually.
 
Jan Groth
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my 2 cents...

i just passed without any notable deduction in that field. so what i did was using the logging-API, with a (documented) philosophy behind the certain loglevels.

mine was:

fine, finer, finest - for debugging
info - for important / interesting system messages ("new client connected"...)
warning - for errorneous, recoverable situations ("data file is locked"...)
severe - for situations were a coder would need to check the code ("primary key rule violated"...)

i left all logging statements in the code, well, i dont think i had many fine, finer, finest in it. i did not submit a configuration file (as this is not allowed), so standard level for all classes is info.

hope it helps,
jan
 
Daniel Dalton
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And on the other hand, I just passed without using the logging API at all - again without noticeable deductions. Also, I didn't justify NOT using it, so I guess it's fairly optional. In real-life, I prefer log4j, though I admit they're fairly similar.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic