• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Logging

 
Anna Hays
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • 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
 
Steve Baranski
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic