User: ejort
Date: 02/01/04 22:39:42
Modified: catalina/src/main/org/jboss/web/catalina
EmbeddedCatalinaServiceSX.java
Log:
Guarded debug logging
Revision Changes Path
1.3 +16 -8
contrib/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSX.java
Index: EmbeddedCatalinaServiceSX.java
===================================================================
RCS file:
/cvsroot/jboss/contrib/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSX.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EmbeddedCatalinaServiceSX.java 2001/09/30 21:06:07 1.2
+++ EmbeddedCatalinaServiceSX.java 2002/01/05 06:39:42 1.3
@@ -63,7 +63,7 @@
@see org.apache.catalina.startup.Embedded
@author [EMAIL PROTECTED]
- @version $Revision: 1.2 $
+ @version $Revision: 1.3 $
*/
public class EmbeddedCatalinaServiceSX extends AbstractWebContainer implements
EmbeddedCatalinaServiceSXMBean
{
@@ -183,6 +183,8 @@
public void startService() throws Exception
{
+ trace = category.isTraceEnabled();
+ debug = category.isDebugEnabled();
category.info("Starting " + NAME + "....");
// Start create the embeded catalina container but don't let it overwrite the
thread class loader
@@ -190,18 +192,21 @@
URLClassLoader parent = cl;
while( parent != null )
{
- category.trace(parent);
+ if (trace)
+ category.trace(parent);
URL[] urls = parent.getURLs();
for(int u = 0; u < urls.length; u ++)
- category.trace(" "+urls[u]);
+ if (trace)
+ category.trace(" "+urls[u]);
parent = (URLClassLoader) parent.getParent();
}
// Determine the catalina debug level from the enabled priority
debugLevel = 0;
- if( category.isTraceEnabled() )
+ if(trace)
debugLevel = 2;
- category.debug("Setting catalina debug level to: "+debugLevel);
+ if (debug)
+ category.debug("Setting catalina debug level to: "+debugLevel);
try
{
@@ -211,7 +216,8 @@
String homePath = catalinaHome.getFile();
File homeDir = new File(homePath, "../../..");
homePath = homeDir.getCanonicalPath();
- category.debug("Setting catalina.home to: " + homePath);
+ if (debug)
+ category.debug("Setting catalina.home to: " + homePath);
System.setProperty("catalina.home", homePath);
System.setProperty("catalina.base", homePath);
initCatalina(cl);
@@ -248,7 +254,8 @@
URL url = new URL(warUrl);
WebApplication appInfo = createWebContext(ctxPath, url, webAppParser);
- category.debug("Initialized: "+appInfo);
+ if (category.isDebugEnabled())
+ category.debug("Initialized: "+appInfo);
return appInfo;
}
@@ -337,7 +344,8 @@
Object source = event.getSource();
if( source == context &&
event.getType().equals(Lifecycle.START_EVENT) )
{
- category.debug("Context.lifecycleEvent, event="+event);
+ if (category.isDebugEnabled())
+ category.debug("Context.lifecycleEvent, event="+event);
contextInit(context, appInfo, webAppParser);
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development