tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServlet.java
Date Wed, 22 Jan 2003 20:39:29 GMT
luehe       2003/01/22 12:39:29

  Modified:    jasper2/src/share/org/apache/jasper/compiler Compiler.java
               jasper2/src/share/org/apache/jasper/servlet JspServlet.java
  Log:
  more logging-related changes
  
  Revision  Changes    Path
  1.46      +0 -8      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- Compiler.java	31 Dec 2002 14:01:17 -0000	1.45
  +++ Compiler.java	22 Jan 2003 20:39:28 -0000	1.46
  @@ -77,10 +77,8 @@
   import org.apache.tools.ant.types.PatternSet;
   
   import org.apache.jasper.JspCompilationContext;
  -import org.apache.jasper.Constants;
   import org.apache.jasper.JasperException;
   import org.apache.jasper.Options;
  -import org.apache.jasper.logging.Logger;
   import org.apache.jasper.util.SystemLogHandler;
   import org.apache.jasper.runtime.HttpJspBase;
   import org.apache.jasper.servlet.JspServletWrapper;
  @@ -148,16 +146,10 @@
           if( project!=null ) return project;
           // Initializing project
           project = new Project();
  -        // XXX We should use a specialized logger to redirect to jasperlog
           logger = new JasperAntLogger();
           logger.setOutputPrintStream(System.out);
           logger.setErrorPrintStream(System.err);
   
  -        if( Constants.jasperLog.getVerbosityLevel() >= Logger.DEBUG ) {
  -            logger.setMessageOutputLevel( Project.MSG_VERBOSE );
  -        } else {
  -            logger.setMessageOutputLevel( Project.MSG_INFO );
  -        }
           if( log.isTraceEnabled() ) {
               logger.setMessageOutputLevel( Project.MSG_VERBOSE );
           }
  
  
  
  1.18      +20 -44    jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServlet.java
  
  Index: JspServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServlet.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- JspServlet.java	22 Jan 2003 20:08:25 -0000	1.17
  +++ JspServlet.java	22 Jan 2003 20:39:29 -0000	1.18
  @@ -83,10 +83,6 @@
   import org.apache.jasper.compiler.JspRuntimeContext;
   import org.apache.jasper.compiler.Localizer;
   
  -import org.apache.jasper.logging.Logger;
  -import org.apache.jasper.logging.DefaultLogger;
  -import org.apache.jasper.logging.JasperLogger;
  -
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  @@ -111,8 +107,6 @@
       // Logger
       private static Log log = LogFactory.getLog(JspServlet.class);
   
  -    private Logger.Helper loghelper;
  -
       private ServletContext context;
       private ServletConfig config;
       private Options options;
  @@ -125,14 +119,6 @@
   	this.config = config;
   	this.context = config.getServletContext();
           
  -	// Setup logging 
  -        Constants.jasperLog = new DefaultLogger(this.context);
  -	Constants.jasperLog.setName("JASPER_LOG");
  -	Constants.jasperLog.setTimestamp("false");
  -	Constants.jasperLog.setVerbosityLevel(
  -            config.getInitParameter("logVerbosityLevel"));
  -        loghelper = new Logger.Helper("JASPER_LOG", "JspServlet");
  -
           options = new EmbededServletOptions(config, context);
   
           // Initialize the JSP Runtime Context
  @@ -235,30 +221,21 @@
   
               boolean precompile = preCompile(request);
   
  -	    Logger jasperLog = Constants.jasperLog;
  -	    
  -            if (jasperLog != null
  -		    && jasperLog.matchVerbosityLevel(Logger.INFORMATION))
  -		{
  -		    jasperLog.log("JspEngine --> "+jspUri);
  -		    jasperLog.log("\t     ServletPath: " +
  -                                  request.getServletPath());
  -		    jasperLog.log("\t        PathInfo: " +
  -                                  request.getPathInfo());
  -		    jasperLog.log("\t        RealPath: " +
  -                                  context.getRealPath(jspUri));
  -		    jasperLog.log("\t      RequestURI: " +
  -                                  request.getRequestURI());
  -		    jasperLog.log("\t     QueryString: " +
  -                                  request.getQueryString());
  -		    jasperLog.log("\t  Request Params: ");
  -		    Enumeration e = request.getParameterNames();
  -		    while (e.hasMoreElements()) {
  -			String name = (String) e.nextElement();
  -			jasperLog.log("\t\t " + name + " = " +
  -                                      request.getParameter(name));
  -		    }
  +	    if (log.isInfoEnabled()) {	    
  +		log.info("JspEngine --> " + jspUri);
  +		log.info("\t     ServletPath: " + request.getServletPath());
  +		log.info("\t        PathInfo: " + request.getPathInfo());
  +		log.info("\t        RealPath: " + context.getRealPath(jspUri));
  +		log.info("\t      RequestURI: " + request.getRequestURI());
  +		log.info("\t     QueryString: " + request.getQueryString());
  +		log.info("\t  Request Params: ");
  +		Enumeration e = request.getParameterNames();
  +		while (e.hasMoreElements()) {
  +		    String name = (String) e.nextElement();
  +		    log.info("\t\t " + name + " = " +
  +			     request.getParameter(name));
   		}
  +	    }
               serviceJspFile(request, response, jspUri, null, precompile);
   	} catch (RuntimeException e) {
   	    throw e;
  @@ -273,10 +250,9 @@
       }
   
       public void destroy() {
  -
  -	if (Constants.jasperLog != null)
  -	    Constants.jasperLog.log("JspServlet.destroy()", Logger.INFORMATION);
  -
  +	if (log.isInfoEnabled()) {
  +	    log.info("JspServlet.destroy()");
  +	}
           rctxt.destroy();
       }
   
  
  
  

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


Mime
View raw message