Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java logging suggestions

 
Darrin Cartwright
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All!

The application I am currently working on uses very basic logging capabilities. All logging is accomplished either with System.out.println() calls, which are redirected to a file when the app starts with the System.setOut() method, or a custom logging class running in it's own thread which provides some basic formatting, file handling, etc. This works, which is about the best thing you can say about it. So, I'm looking into using one of the logging APIs. I've found log4j, and the java.util.logging API. Does anyone have any advice on either of these APIs, or maybe an API I haven't run across? We currently are using Java 5, and on the way to 6.

Thanks!

Darrin
 
Joe Ess
Bartender
Pie
Posts: 9258
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
log4j and java.util.logging have been functionally identical for my purposes. I say flip a coin. You can use the Jakarta Commons Logging component to make it easy to switch between logging implementations if you are worried about making the wrong choice.
 
Darrin Cartwright
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you're right. The only difference I can come up with is having to bundle the log4j with my app.

Thanks for the opinion Joe!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic