Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Logging needed?

 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic