cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/servlet CocoonServlet.java
Date Thu, 06 Sep 2001 17:37:58 GMT
dims        01/09/06 10:37:58

  Modified:    src/org/apache/cocoon/servlet CocoonServlet.java
  Log:
  dumps stuff onto stdout when logkit.xconf is missing.
  
  Revision  Changes    Path
  1.37      +18 -16    xml-cocoon2/src/org/apache/cocoon/servlet/CocoonServlet.java
  
  Index: CocoonServlet.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/servlet/CocoonServlet.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- CocoonServlet.java	2001/09/04 12:13:37	1.36
  +++ CocoonServlet.java	2001/09/06 17:37:58	1.37
  @@ -67,7 +67,7 @@
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
    * @author <a href="mailto:leo.sutic@inspireinfrastructure.com">Leo Sutic</a>
  - * @version CVS $Revision: 1.36 $ $Date: 2001/09/04 12:13:37 $
  + * @version CVS $Revision: 1.37 $ $Date: 2001/09/06 17:37:58 $
    */
   
   public class CocoonServlet extends HttpServlet {
  @@ -358,33 +358,35 @@
           Hierarchy.getDefaultHierarchy().setDefaultLogTarget(servTarget);
           Hierarchy.getDefaultHierarchy().setDefaultPriority(logPriority);
           final Logger logger = Hierarchy.getDefaultHierarchy().getLoggerFor("");
  +        final DefaultLogKitManager logKitManager = new DefaultLogKitManager();
  +        logKitManager.setLogger(logger);
  +        final DefaultContext subcontext = new DefaultContext(this.appContext);
  +        subcontext.put("servlet-context", this.servletContext);
  +        subcontext.put("context-root", this.servletContext.getRealPath("/"));
   
           try {
  -            final String logkitConfig = getInitParameter("logkit-config");
  -            
  +            logKitManager.contextualize(subcontext);
  +            this.logKitManager = logKitManager;
  +
               //Configure the logkit management
  +            final String logkitConfig = getInitParameter("logkit-config");
               if (logkitConfig != null) {
                   final FileInputStream fis = new FileInputStream(this.servletContext.getRealPath("/")
+ logkitConfig);
                   final DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
                   final Configuration conf = builder.build(fis);
  -                final DefaultLogKitManager logKitManager = new DefaultLogKitManager();
  -                logKitManager.setLogger(logger);
  -                final DefaultContext subcontext = new DefaultContext(this.appContext);
  -                subcontext.put("servlet-context", this.servletContext);
  -                subcontext.put("context-root", this.servletContext.getRealPath("/"));
  -                logKitManager.contextualize(subcontext);
                   logKitManager.configure(conf);
  -                this.logKitManager = logKitManager;
  -                final String cocoonLogger = getInitParameter("servlet-logger");
  -                if (cocoonLogger != null) {
  -                    this.log = logKitManager.getLogger(cocoonLogger);
  -                } else {
  -                    this.log = logKitManager.getLogger("cocoon");
  -                }
               }
           } catch (Exception e) {
               Hierarchy.getDefaultHierarchy().log("Could not set up Cocoon Logger, will use
screen instead", e);
           }
  +
  +        final String cocoonLogger = getInitParameter("servlet-logger");
  +        if (cocoonLogger != null) {
  +            this.log = logKitManager.getLogger(cocoonLogger);
  +        } else {
  +            this.log = logKitManager.getLogger("cocoon");
  +        }
  +
       }
   
       /**
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message