• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Logging needed?

 
Muthaiah Ramanathan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Frans Janssen
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Titus Barik
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Josh Allen
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic