wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Logging needed? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Logging needed?" Watch "Logging needed?" New topic
Author

Logging needed?

Muthaiah Ramanathan
Ranch Hand

Joined: May 16, 2005
Posts: 102
Besides the system output, I planned to have logging in the assignment using java.util.logging.Logger & java.util.logging.SimpleFormatter, but I am having second thought whether it will make any sense or not. Because the log file seems to be very hard to read. Have any one done this?


SCJP 1.6, SCJD, SCWCD, SCBCD.

Be nice to people on the way up cos, you'll need 'em on your way down - From somewhere I can't remember!
Frans Janssen
Ranch Hand

Joined: Dec 29, 2004
Posts: 357
Originally posted by Muthaiah Ram:
Besides the system output, I planned to have logging in the assignment using java.util.logging.Logger & java.util.logging.SimpleFormatter, but I am having second thought whether it will make any sense or not. Because the log file seems to be very hard to read. Have any one done this?

Hi Muthaiah,

I provided logging in a similar way in my assignment. The logging would be enabled by setting a property (which was disabled by default).

I made the logging solely for the purposes of testing and debugging my code, so I provided it as an undocumented feature.

Frans.


SCJP 1.4, SCJD
Titus Barik
Greenhorn

Joined: May 15, 2005
Posts: 24
Originally posted by Muthaiah Ram:
Besides the system output, I planned to have logging in the assignment using java.util.logging.Logger & java.util.logging.SimpleFormatter, but I am having second thought whether it will make any sense or not. Because the log file seems to be very hard to read. Have any one done this?


I used the Logger facilities, but only for personal debugging purposes. Before that I was using plain old SOP statements and that got to be a bit annoying.
Zee Ho
Ranch Hand

Joined: Jul 20, 2004
Posts: 128
I implemented the java logging, I think it provides a good way to handle the exceptions that should not be thrown out. And also the log file probably gives the administrator some information about whether the system is strted up normally or not

The way that read a properties file is not that hard. you can integrate it with suncertify.properties file, you only need to provide some necessary properties like
java.util.logging.FileHandler.pattern=YOU LOG FILE
handlers=java.util.logging.FileHandler
.level=INFO
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
java.util.logging.FileHandler.limit=50000
java.util.logging.FileHandler.count=5

Certainly, you can not provide a predefined properties file, It should be generated dynamically.


SCJP 1.4<br />SCWCD 1.3<br />SCJD<br />SCBCD<br />IBM Xml Cert in progress
Josh Allen
Ranch Hand

Joined: Jan 15, 2005
Posts: 37
I used the standard logging mechanism as well. I had a logging.properties file that I used while developing, but am not going to include when submitting. There is no need to generate it dynamically, as java includes many ways to for the user configure the logging themselves if they want something different then the default.
Josh Allen
Ranch Hand

Joined: Jan 15, 2005
Posts: 37
I forgot to mention that not including the logging properties in your submission works because during development it is specfied on the command line using the standard mechanism of setting the System property java.util.logging.config.file.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Logging needed?