Let me start by admitting that I don't know what I am talking about. This is more of a complaint than a confession since I am reasonably bright and have spent quite a bit of effort trying to figure it all out.
If I am careful not to configure anything then the commons-logging classes seem to find the logger the server is using and hook me up. I can log "info"s and "errors" which appear on the console and in the Tomcat log. "Debug" log entries are ignored because they are below the servers criterion. This is good enough for my code and, if I could figure out how to set the debug level for my loggers I would probably be happy.
There are a number of ways in Struts to set the debug level (on the controller in the struts-config, for one) but, on close reading they appear to be deprecated in favor of configuring the underlying logging implementation.
I've used Log4J in the past so that sounded ok but I seem to be having class loader problems with Tomcat when I try. When I attempt to do my own logging (putting the log4j jar file in my WEB-INF/lib directory and log4j.properties in my classpath) Tomcat throws an error -- LogConfigurationException: No suitable Log constructor. A bit of Googling suggested that most people with this problem move the log4j jar to the server/lib directory (presumably so that all of the logging classes will be in the servers class loader.) This is unappealing to me since it means that I can only control logging of my webapp on machines where I have access to the server. On machines where I can only deploy via a WAR file I can't set the debug level.
I'm sure I am barking up the wrong tree here. I really hadn't planned to spend a lot of time getting the logging to work. As things stand right now I am definitely hearing the siren song of System.out.println().
Lee
_______________________________________________ Juglist mailing list [EMAIL PROTECTED] http://trijug.org/mailman/listinfo/juglist_trijug.org
