File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes New to logging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "New to logging" Watch "New to logging" New topic

New to logging

David Duran
Ranch Hand

Joined: Feb 11, 2002
Posts: 122
I need to implement some type of logging scheme for things like database transactions, method calls, etc., and possibly things like stack traces if an error occurs. Multiple RMI server apps on a single machine would be logging to a single file on the same machine.
I've never done logging. To me, the simplest form would be to simply just write to a file hahaha. But I've come across things like log4j and the logging package in jdk 1.4. Does anyone have some input if either of those 2 might be of use or should I stick to the simple idea of writing to a file?
Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 515
I use log4j. That works pretty good. Easy to implement and great for debugging. In fact that is what I use it for is debugging. I have one instance per class implemented for debugging purposes. FYI .. works good

By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)
David Duran
Ranch Hand

Joined: Feb 11, 2002
Posts: 122
I was looking into the jdk 1.4 java.util.logging feature but came across this interesting page java.util.logging vs log4j and decided to give a read on the documentation for log4j.
So far so good, except that it's so involved I have to look at all the different ways to implement it for what I need it for.
I agree. Here's the link:
subject: New to logging
It's not a secret anymore!