• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with Log

 
Fernando Franzini
Ranch Hand
Posts: 489
2
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers

I need some help and tips with how to log my assignment....so here we go :
1. I need log every method ?
2. Or just publics ones ?
3. Do I need log private methods that are called by public log ones inside the class ?
4. Do I need log get's and set's mehods ? Why ? It dont make sense ?
5. There are some right patter ? how ? I saw DVD Monkhouse simple like:

public void doSomenthing(params...) {
log.entering("ClassName", "ClassMethod", params...);
//executing somenthing
//log.info("informations stuf");
//log.warning("dangerous stuff");
log.exiting("ClassName", "ClassMethod");
}



 
K. Tsang
Bartender
Posts: 3508
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Fernando, the question to ask yourself is do you need the logging feature in your assignment?
I see logging can be helpful to determine why such function throw exceptions especially on the server side. On the other hand, depend on what you do with your logging, how do you determine the exception's severity - prompt to the client, ignore it, shutdown server etc?

Some people that used logging in the beginning of the assignment do in fact end up taking it out for final submission. Again some people keep it to reduce messing up what they already have. There is a logging API in the Java API, you may want to look at it. Remember for the SCJD the key is to keep it simple, make sure everything works as expected especially locking.
 
Fernando Franzini
Ranch Hand
Posts: 489
2
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi K.

I really dont like Log...but i'm aware about benefits. Anyway,......I've read that I can lose some general point....so....why not put it ?? lollll ....I've read here that there were some people that passed without any log...
I dont know much about log...so if someone could take me some tips.....
Regards...
 
K. Tsang
Bartender
Posts: 3508
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fernando Franzini wrote:I really dont like Log...but i'm aware about benefits. Anyway,......I've read that I can lose some general point....so....why not put it ?? lollll ....I've read here that there were some people that passed without any log...
I dont know much about log...so if someone could take me some tips.....


If 1) you don't like log and 2) the assignment doesn't "require" logging, then why are you still considering the logging feature. Beside getting say logging to work just for the sake of logging may delay your progress of the assignment. Why you consider focusing on the real issues like the network server, locking, and Data class.

And depending on where you are, logging feature can just make or break your application.
 
Roel De Nijs
Sheriff
Posts: 10409
133
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Fernando,

At first I decided not to use logging feature (because it is not required by assignment) and used sysouts to print parameters and return values, giving me some debug information during the development process. My intention was to delete these sysouts before submitting, but at last I decided to just use the logging-feature.

I turned the logging completely off when submitted the assignment and argued in my choices.txt that the logging could be easily turned back on giving valuable debug information when some changes are made or new functionalities are added to the program

Kind regards,
Roel

 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel De Nijs wrote:I turned the logging completely off when submitted the assignment and argued in my choices.txt that the logging could be easily turned back on giving valuable debug information when some changes are made or new functionalities are added to the program


Good call!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic