Hi All,

        Hope all is well.

        I know TC322 is now in maintainence mode, but FWIW, here's a patch
        that allows you to specify append="boolean" in the Logger definitions
        of the server.xml. This allows you to configure appending to log
        files in the server.xml.

        Is such functionality already in TC33 or T4 ?

        Cheers,

        Marcus

-- 
        .....
     ,,$$$$$$$$$,      Marcus Crafter
    ;$'      '$$$$:    Computer Systems Engineer
    $:         $$$$:   Open Software Associates GmbH
     $       o_)$$$:   82-84 Mainzer Landstrasse
     ;$,    _/\ &&:'   60327 Frankfurt Germany
       '     /( &&&
           \_&&&&'     Email : [EMAIL PROTECTED]
          &&&&.        Business Hours : +49 69 9757 200
    &&&&&&&:
Index: src/share/org/apache/tomcat/logging/Logger.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tomcat/src/share/org/apache/tomcat/logging/Attic/Logger.java,v
retrieving revision 1.7.4.1
diff -u -r1.7.4.1 Logger.java
--- src/share/org/apache/tomcat/logging/Logger.java     2000/07/06 22:20:17     
1.7.4.1
+++ src/share/org/apache/tomcat/logging/Logger.java     2001/07/10 10:20:47
@@ -236,7 +236,7 @@
            if (!file.exists())
                new File(file.getParent()).mkdirs();
            
-           this.sink = new FileWriter(path);
+           this.sink = new FileWriter(path, append);
        } catch (IOException ex) {
            System.err.print("Unable to open log file: "+path+"! ");
            System.err.println(" Using stderr as the default.");
@@ -253,6 +253,19 @@
     public static final int INFORMATION = 3;
     public static final int DEBUG = 4;
     
+    /**
+     * Set whether this logger should append to log files or not. Default is
+     * not to.
+     *
+     * @param  flag            boolean string indicated whether or not logs
+     *                         should be appended to.
+     */
+    public void setAppend(String flag) {
+        if ("true".equalsIgnoreCase(flag))
+           this.append = true;
+       else
+           this.append = false;
+    }
 
     /**
      * Set the verbosity level for this logger. This controls how the
@@ -398,6 +411,7 @@
     protected static Hashtable loggers = new Hashtable(5);
 
     private int level = WARNING;
+    private boolean append = false;
 
     /**
      * Should we timestamp this log at all?

Reply via email to