pbwest      2004/03/08 14:59:55

  Modified:    src/java/org/apache/fop/apps Tag: FOP_0-20-0_Alt-Design
                        Fop.java
  Log:
  Initialize system properties for logging before setting up Logger.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.9   +29 -5     xml-fop/src/java/org/apache/fop/apps/Fop.java
  
  Index: Fop.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Fop.java,v
  retrieving revision 1.1.2.8
  retrieving revision 1.1.2.9
  diff -u -r1.1.2.8 -r1.1.2.9
  --- Fop.java  6 Mar 2004 05:53:16 -0000       1.1.2.8
  +++ Fop.java  8 Mar 2004 22:59:55 -0000       1.1.2.9
  @@ -20,9 +20,15 @@
   
   package org.apache.fop.apps;
   
  +//import java.util.logging.Handler;
  +import java.io.IOException;
  +import java.io.InputStream;
  +import java.util.Enumeration;
  +import java.util.Properties;
   import java.util.logging.Level;
   import java.util.logging.Logger;
   
  +import org.apache.fop.configuration.ConfigurationResource;
   import org.apache.fop.configuration.Configuration;
   
   public class Fop {
  @@ -39,16 +45,34 @@
        */
       public static final String fopPackage = "org.apache.fop";
       
  -    public static final Logger logger = Logger.getLogger(fopPackage);
  -    static {
  -        logger.setLevel(Level.INFO);
  -    }
  +    private static Logger logger;
       
       public Configuration configuration = new Configuration();
   
       public static void main(String[] args) {
   
           long endtotal, endfree, gctotal, gcfree;
  +        Properties properties;
  +        try {
  +            // Get the initial system properties
  +            InputStream propsfile =
  +                ConfigurationResource.getResourceFile(
  +                        "conf/fop.system.properties", Fop.class);
  +            properties = new Properties();
  +            properties.load(propsfile);
  +        } catch (FOPException e1) {
  +            throw new RuntimeException(e1);
  +        } catch (IOException e1) {
  +            throw new RuntimeException(e1);
  +        }
  +        Enumeration props = properties.keys();
  +        while (props.hasMoreElements()) {
  +            String key = (String)(props.nextElement());
  +            System.setProperty(key, properties.getProperty(key));
  +        }
  +        // Now that the Fop system properties have been added, set up logger
  +        logger = Logger.getLogger(fopPackage);
  +        // Then restrict to WARNING
           Driver driver;
           Configuration configuration;
           FOPOptions options = null;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to