cziegeler    01/07/13 07:09:22

  Modified:    src/org/apache/cocoon Main.java
  Log:
  Fix for command line generator. The log dir and log file of the context were not set
  
  Revision  Changes    Path
  1.9       +14 -4     xml-cocoon2/src/org/apache/cocoon/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/Main.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Main.java 2001/07/04 07:56:38     1.8
  +++ Main.java 2001/07/13 14:09:17     1.9
  @@ -48,7 +48,7 @@
    * Command line entry point.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.8 $ $Date: 2001/07/04 07:56:38 $
  + * @version CVS $Revision: 1.9 $ $Date: 2001/07/13 14:09:17 $
    */
   
   public class Main {
  @@ -125,6 +125,7 @@
           boolean xspOnly = false;
           String userAgent = DEFAULT_USER_AGENT;
           String accept = DEFAULT_ACCEPT;
  +        String logDir = "", logFile = "";
   
           List clOptions = parser.getArguments();
           int size = clOptions.size();
  @@ -184,11 +185,18 @@
               log = Hierarchy.getDefaultHierarchy().getLoggerFor("cocoon");
               log.setPriority(priority);
   
  -
  -            if(logUrl == null)
  +            // FIXME
  +            // The log dir and log file must be detected correct
  +            // This is only a simple hack to make the sitemap manager happy
  +            if(logUrl == null) {
                   log.setLogTargets( new LogTarget[] {new 
DefaultOutputLogTarget(System.out)});
  -            else
  +                logDir = "";
  +                logFile = "";
  +            } else {
                   log.setLogTargets(new LogTarget[] {new 
FileOutputLogTarget(logUrl)});
  +                logFile = logUrl;
  +                logDir = "";
  +            }
           } catch (MalformedURLException mue) {
               String error = "Cannot write on the specified log file.  Please, make 
sure the path exists and you have write permissions.";
               Hierarchy.getDefaultHierarchy().log(error, mue);
  @@ -240,6 +248,8 @@
               appContext.put(Constants.CONTEXT_WORK_DIR, work);
               appContext.put(Constants.CONTEXT_UPLOAD_DIR, contextDir + "image-dir");
               appContext.put(Constants.CONTEXT_CONFIG_URL, conf.toURL());
  +            appContext.put(Constants.CONTEXT_LOG_DIR, logDir);
  +            appContext.put(Constants.CONTEXT_LOG_FILE, logFile);
               Cocoon c = new Cocoon();
               c.setLogger(log);
               c.contextualize(appContext);
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to