• 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Java Logging

 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I found the provided Logger in the JDK very confusing and has way more than I needed. Does anyone think it is a bad idea to create your own logging facilities? I have been thinking about that for a while now. Thanks for any suggestions.

Anna
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Anna - My assignment has the following excerpt in the instructions, which I assume to be standard verbiage:

Use of Standard Elements
Use of functionality provided by the core Java classes will be preferred to your own implementation of that functionality, unless there is a specific advantage to providing your own implementation.


As you consider implementing your own logging, I would keep this in mind.

Now if you were considering a tool such as log4j, Jakarta Commons logging, etc., there is completely different text in the assignment that should give you pause...

The final program must have no dependencies on any libraries other than those of the Java 2 Platform.

I hope this gives you some assurance about how to proceed.
 
Anna Hays
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Steve. I found the provided logging facilities overkills the purpose I need. But I guess I have to take another look at it. Thanks for your help

Anna
 
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Anna

I daresay that maybe you could simply write the exceptions to the standard error output and at runtime set the err PrintStream to write your exceptions to a file with System.setErr(PrintStream xyz).

This would be a simpler approach than the logging approach you would like to avoid, and still you would no be suggesting a new implementation of the Standard API.
 
reply
    Bookmark Topic Watch Topic
  • New Topic