Convert xserver from System.out to commons logging

Description

If there is any remaining use of the java class System to output debugging info or error info, replace with commons logging. Examples of statements that should be removed include:
System.out.println(" ... ");
System.err.println(" ... ");
e.printStackTrace();

Environment

None

Activity

Gaurav Cedric Bhatnagar October 11, 2006 at 2:31 PM

a side-effect of using commons-logging was that the usage of org.osid.logging implementations was dropped. It may have been best to keep both, or use all org.osid.logging since this is an OSID, but, the org.osid.logging implementations required making multiple logs (WritableLog) for each level of logging (i.e. debug, warn, etc.). I guess I just didn't want to do this at this time. Maybe in the future we can switch over to all org.osid.logging instead of commons-logging. But, for now, commons-logging is working well.

Gaurav Cedric Bhatnagar October 9, 2006 at 1:55 PM

I'm planning on using the following logging levels, as per the Commons Logging API (http://jakarta.apache.org/commons/logging/commons-logging-1.0.4/docs/apidocs/org/apache/commons/logging/Log.html):
1. trace (the least serious)
2. debug
3. info
4. warn
5. error
6. fatal (the most serious)

It looks like the standard level of Logging set for Tomcat is at the INFO level. I don't think I will use the trace logging level.

Jim Eng October 8, 2006 at 6:45 AM

Here's an example of a logging message that generates a stack trace:

try{ ... } catch(Exception e) {
M_log.warn("checkCitation(" + citationId + ") ", e);
}

But sometimes a stack trace is not needed; it's enough to log just the fact that an exception was caught and a little into about it.

try{ ... } catch(Exception e) {
M_log.warn("checkCitation(" + citationId + ") " + e.getMessage());
}

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created October 8, 2006 at 6:24 AM
Updated November 30, 2012 at 5:59 AM
Resolved October 11, 2006 at 2:28 PM