DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=9039>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=9039


[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|minor                       |normal
   Target Milestone|---                         |2.0




------- Additional Comments From [EMAIL PROTECTED]  2004-11-18 01:37 -------
The SimpleLog4JLogSystem is deprecated, but should still be fixed.  This problem
also applies to the replacement class Log4JLogSystem.  How about a patch like 
this?:

* src/java/org/apache/velocity/runtime/log/Log4JLogSystem.java
  appender: Expose to shutdown().

  internalInit(String): Use this.appender.

  shutdown(): Close only our appender.

Index: src/java/org/apache/velocity/runtime/log/Log4JLogSystem.java
===================================================================
--- src/java/org/apache/velocity/runtime/log/Log4JLogSystem.java       
(revision 76173)
+++ src/java/org/apache/velocity/runtime/log/Log4JLogSystem.java        (working
copy)
@@ -55,6 +55,12 @@
 
     /**
      * <a href="http://jakarta.apache.org/log4j/";>Log4J</a>
+     * file appender for our [EMAIL PROTECTED] #logger}.
+     */
+    private RollingFileAppender appender = null;
+
+    /**
+     * <a href="http://jakarta.apache.org/log4j/";>Log4J</a>
      * logging API.
      */
     public Log4JLogSystem()
@@ -127,7 +133,7 @@
          */
         logger.setLevel(Level.DEBUG);
 
-        RollingFileAppender appender = new RollingFileAppender(
+        appender = new RollingFileAppender(
                 new PatternLayout( "%d - %m%n"), logfile, true);
         
         appender.setMaxBackupIndex(1);
@@ -177,10 +183,8 @@
     /** Close all destinations*/
     public void shutdown()
     {
-        Enumeration appenders = logger.getAllAppenders();
-        while (appenders.hasMoreElements())
+        if (appender != null)
         {
-            Appender appender = (Appender)appenders.nextElement();
             appender.close();
         }
     }


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

Reply via email to