tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Yunusov <pyunu...@rogers.com>
Subject Re: How do I...
Date Fri, 10 Jan 2003 21:13:28 GMT
On Friday 10 January 2003 04:03 pm, Luc Foisy wrote:
> Could I pass the ServletContext to my jar application, and reroute
> System.out in there with System static void setOut(PrintStream out) ? Do
> you see any issues with that?
>
> I briefly looked at the Tomcat source to see what it was doing
> Catalina.java is just routing all System.out to SystemLogHandler.java (
> which is a PrintStream ) Not quite sure at the moment where the Contexts
> come into play ( not sure where they are linked to that same
> SystemLogHandler ) Where does the context logger parameter from server.xml
> get loaded in?
>
> What do you think Tomcat would do if I snafu'd my System.out?

I guess you could write a custom OutputStream subclass for the System.out in 
your non-servlet classes that would interface with the layer that connects 
those classes to the webapp and specifically with Logger instances.

However, I think this approach would violate the KISS rule and attract the 
wrath of future generations of programmers (or your colleagues).

It's really easier to replace System.out.print() with commons-logging calls 
judging from the information you supplied but it's your call.

Paul

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message