incubator-ftpserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r511288 [1/3] - in /incubator/ftpserver: branches/perftest/ trunk/admin-gui/ trunk/admin-gui/src/java/org/apache/ftpserver/gui/ trunk/admin-gui/src/test/ trunk/core/ trunk/core/src/java/org/apache/ftpserver/ trunk/core/src/java/org/apache/f...
Date Sat, 24 Feb 2007 15:50:25 GMT
Author: ngn
Date: Sat Feb 24 07:50:22 2007
New Revision: 511288

URL: http://svn.apache.org/viewvc?view=rev&rev=511288
Log:
Replacing commons-logging with SFL4J
Replacing dynamic proxy logger with log4j appender
Removed logfactory from context, instead create as usual as static final.
Cleaning dependencies in POMs

Removed:
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpLogFactory.java
Modified:
    incubator/ftpserver/branches/perftest/pom.xml
    incubator/ftpserver/trunk/admin-gui/pom.xml
    incubator/ftpserver/trunk/admin-gui/src/java/org/apache/ftpserver/gui/FtpConnectionTableModel.java
    incubator/ftpserver/trunk/admin-gui/src/java/org/apache/ftpserver/gui/LoggerPanel.java
    incubator/ftpserver/trunk/admin-gui/src/test/log4j.properties
    incubator/ftpserver/trunk/core/pom.xml
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/Bean.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ComponentBean.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ConfigurableFtpServerContext.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultCommandFactory.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultDataConnectionConfig.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultFtpServerContext.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpDataConnectionFactory.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpServer.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpStatisticsImpl.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpWriter.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/PojoBean.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/APPE.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/AUTH.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/AbstractCommand.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CDUP.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CWD.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/DELE.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/EPRT.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/LIST.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MD5.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MDTM.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MKD.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLSD.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLST.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NLST.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/OPTS.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASS.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PORT.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/REST.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RETR.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RMD.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNFR.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNTO.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_DESCUSER.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SIZE.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOR.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STRU.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/TYPE.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/commandline/Daemon.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/filesystem/NativeFileSystemManager.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ftplet/DefaultFtpletContainer.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/iprestrictor/FileIpRestrictor.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/AbstractConnection.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/ConnectionManagerImpl.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/FtpProtocolHandler.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOConnection.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOListener.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaListener.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/message/MessageResourceImpl.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/socketfactory/FtpSocketFactory.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ssl/DefaultSsl.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/DbUserManager.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/LdapUserManager.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/PropertiesUserManager.java
    incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ComponentBeanTest.java
    incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/PojoBeanTest.java
    incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/usermanager/DbUserManagerTest.java
    incubator/ftpserver/trunk/distribution/pom.xml
    incubator/ftpserver/trunk/ftplet-api/pom.xml
    incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/Component.java
    incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpletContext.java
    incubator/ftpserver/trunk/ssl-tests/pom.xml
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/SSLTestTemplate.java

Modified: incubator/ftpserver/branches/perftest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ftpserver/branches/perftest/pom.xml?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/branches/perftest/pom.xml (original)
+++ incubator/ftpserver/branches/perftest/pom.xml Sat Feb 24 07:50:22 2007
@@ -58,31 +58,13 @@
             <artifactId>ftpserver-core</artifactId>
             <version>1.0-incubator-SNAPSHOT</version>
         </dependency>
-        <dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-            <version>1.1</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>avalon-framework</groupId>
-                    <artifactId>avalon-framework</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>javax.servlet</groupId>
-                    <artifactId>servlet-api</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>log4j</groupId>
-                    <artifactId>log4j</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>logkit</groupId>
-                    <artifactId>logkit</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-
         <!--Only used for testing -->
+        <dependency>
+	      <groupId>org.slf4j</groupId>
+	      <artifactId>slf4j-log4j12</artifactId>
+	      <version>${slf4j-version}</version>
+	      <scope>test</scope>
+	    </dependency>
         <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>

Modified: incubator/ftpserver/trunk/admin-gui/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/admin-gui/pom.xml?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/admin-gui/pom.xml (original)
+++ incubator/ftpserver/trunk/admin-gui/pom.xml Sat Feb 24 07:50:22 2007
@@ -45,27 +45,19 @@
       <version>1.0-incubator-SNAPSHOT</version>
     </dependency>
     <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
-      <version>${commons-logging-version}</version>
-      <exclusions>
-        <exclusion>
-          <artifactId>avalon-framework</artifactId>
-          <groupId>avalon-framework</groupId>
-        </exclusion>
-        <exclusion>
-          <artifactId>servlet-api</artifactId>
-          <groupId>javax.servlet</groupId>
-        </exclusion>
-        <exclusion>
-          <artifactId>log4j</artifactId>
-          <groupId>log4j</groupId>
-        </exclusion>
-        <exclusion>
-          <artifactId>logkit</artifactId>
-          <groupId>logkit</groupId>
-        </exclusion>
-      </exclusions>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>${slf4j-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <version>${slf4j-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>${log4j-version}</version>
     </dependency>
   </dependencies>
   <reporting>

Modified: incubator/ftpserver/trunk/admin-gui/src/java/org/apache/ftpserver/gui/FtpConnectionTableModel.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/admin-gui/src/java/org/apache/ftpserver/gui/FtpConnectionTableModel.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/admin-gui/src/java/org/apache/ftpserver/gui/FtpConnectionTableModel.java (original)
+++ incubator/ftpserver/trunk/admin-gui/src/java/org/apache/ftpserver/gui/FtpConnectionTableModel.java Sat Feb 24 07:50:22 2007
@@ -30,7 +30,6 @@
 import javax.swing.event.TableModelListener;
 import javax.swing.table.TableModel;
 
-import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.FtpSession;
 import org.apache.ftpserver.ftplet.User;
 import org.apache.ftpserver.interfaces.FtpServerContext;

Modified: incubator/ftpserver/trunk/admin-gui/src/java/org/apache/ftpserver/gui/LoggerPanel.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/admin-gui/src/java/org/apache/ftpserver/gui/LoggerPanel.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/admin-gui/src/java/org/apache/ftpserver/gui/LoggerPanel.java (original)
+++ incubator/ftpserver/trunk/admin-gui/src/java/org/apache/ftpserver/gui/LoggerPanel.java Sat Feb 24 07:50:22 2007
@@ -40,10 +40,13 @@
 import javax.swing.text.SimpleAttributeSet;
 import javax.swing.text.StyleConstants;
 
-import org.apache.commons.logging.Log;
-import org.apache.ftpserver.FtpLogFactory;
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.util.IoUtils;
+import org.apache.log4j.Appender;
+import org.apache.log4j.AppenderSkeleton;
+import org.apache.log4j.Level;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.spi.LoggingEvent;
 
 /**
  * This logger panel writes the log messages.
@@ -51,7 +54,7 @@
  * @author <a href="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
  */
 public 
-class LoggerPanel extends PluginPanel implements Log {
+class LoggerPanel extends PluginPanel {
     
     private static final long serialVersionUID = 5988947217051710193L;
     private static final int MAX_CHARS = 8192;
@@ -61,22 +64,18 @@
     private final static Color COLOR_WARN  = new Color(245, 150, 45);
     private final static Color COLOR_ERROR = new Color(255, 0, 0);
 
-    private final static String[] LEVELS = new String[] {
-        "TRACE",
-        "DEBUG",
-        "INFO ",
-        "WARN ",
-        "ERROR",
-        "FATAL",
-        "NONE "
+    private final static Level[] LEVELS = new Level[] {
+        Level.TRACE,
+        Level.DEBUG,
+        Level.INFO,
+        Level.WARN,
+        Level.ERROR,
+        Level.FATAL,
+        Level.OFF
     };
     
-    private final static int LEVEL_TRACE = 0;
-    private final static int LEVEL_DEBUG = 1;
+
     private final static int LEVEL_INFO  = 2;
-    private final static int LEVEL_WARN  = 3;
-    private final static int LEVEL_ERROR = 4;
-    private final static int LEVEL_FATAL = 5;
     
     private int logLevel = LEVEL_INFO;
 
@@ -91,6 +90,28 @@
     private SimpleAttributeSet warnAttr;
     private SimpleAttributeSet errorAttr;
 
+    private class LoggerPanelAppender extends AppenderSkeleton {
+
+        protected void append(LoggingEvent event) {
+            if(isEnabled(event.getLevel())) {
+                String msg = '[' + event.getLevel().toString() + "] " + event.getMessage().toString() + '\n';
+                write(event.getLevel(), String.valueOf(msg));
+                
+                if(event.getThrowableInformation() != null) {
+                    write(event.getLevel(), IoUtils.getStackTrace(event.getThrowableInformation().getThrowable()));
+                }
+            }
+            
+        }
+
+        public void close() {
+            // do nothing
+        }
+
+        public boolean requiresLayout() {
+            return false;
+        }
+    }
     
     /**
      * Constructor - set the container.
@@ -112,37 +133,27 @@
         StyleConstants.setForeground(errorAttr, COLOR_ERROR);
         
         initComponents();
+        
+        Appender appender = new LoggerPanelAppender();
+        LogManager.getRootLogger().addAppender(appender);
     }
     
     /**
      * Return appropriate attribute.
      */
-    private SimpleAttributeSet getAttributeSet(int level) {
+    private SimpleAttributeSet getAttributeSet(Level level) {
         
         SimpleAttributeSet attr = null;
-        switch(level) {
-            case LEVEL_TRACE:
-            case LEVEL_DEBUG:
-                attr = debugAttr;
-                break;
-            
-            case LEVEL_INFO:
-                attr = infoAttr;
-                break;
-                
-            case LEVEL_WARN:
-                attr = warnAttr;
-                break;
-                
-            case LEVEL_ERROR:
-            case LEVEL_FATAL:
-                attr = errorAttr;
-                break;
-            
-            default:
-                attr = infoAttr;
-                break;
+        if(level.isGreaterOrEqual(Level.ERROR)) {
+            attr = errorAttr;
+        } else if(level.isGreaterOrEqual(Level.WARN)) {
+            attr = warnAttr;
+        } else if(level.isGreaterOrEqual(Level.INFO)) {
+            attr = infoAttr;
+        }else {
+            attr = debugAttr;
         }
+
         return attr;
     }
     
@@ -207,6 +218,8 @@
      */
     public void refresh(FtpServerContext serverContext) {
         
+        this.serverContext = serverContext;
+        
         // remove old log messages
         try {
             doc.remove(0, doc.getLength());
@@ -214,21 +227,6 @@
         catch(Exception ex) {
             ex.printStackTrace();
         }
-        
-        // remove from the previous log factory
-        if(this.serverContext != null) {
-            FtpLogFactory factory = (FtpLogFactory)this.serverContext.getLogFactory();
-            if(factory != null) {
-                factory.removeLog(this);
-            }
-        }
-
-        // add this logger
-        this.serverContext = serverContext;
-        if(serverContext != null) {
-            FtpLogFactory factory = (FtpLogFactory)serverContext.getLogFactory();
-            factory.addLog(this);
-        }
     }
     
     /** 
@@ -256,56 +254,17 @@
     /**
      * Check log enable. 
      */
-    private boolean isEnabled(int level) {
-        return logLevel <= level;
-    }
-    
-    /**
-     * Is trace enebled?
-     */
-    public boolean isTraceEnabled() {
-        return isEnabled(LEVEL_TRACE);
-    }
-    
-    /**
-     * Is debug enabled?
-     */
-    public boolean isDebugEnabled() {
-        return isEnabled(LEVEL_DEBUG);
-    }
-    
-    /**
-     * Is info enabled?
-     */
-    public boolean isInfoEnabled() {
-        return isEnabled(LEVEL_INFO);
-    }
-    
-    /**
-     * Is warn enabled?
-     */
-    public boolean isWarnEnabled() {
-        return isEnabled(LEVEL_WARN);
+    private boolean isEnabled(Level level) {
+        Level activeLevel = LEVELS[logLevel];
+        
+        return level.isGreaterOrEqual(activeLevel);
     }
     
-    /**
-     * Is error enabled?
-     */
-    public boolean isErrorEnabled() {
-        return isEnabled(LEVEL_ERROR);
-    }
-    
-    /**
-     * Is fatal enabled?
-     */
-    public boolean isFatalEnabled() {
-        return isEnabled(LEVEL_FATAL);
-    }
     
     /**
      * Write message
      */
-    private void write(final int level, final String message) {
+    private void write(final Level level, final String message) {
         SwingUtilities.invokeLater(new Runnable() {
             public void run() {
                 try {    
@@ -325,131 +284,5 @@
                 } 
             }
         });
-    }
-    
-    /**
-     * Write trace message.
-     */
-    public void trace(Object msg) {
-        if(isEnabled(LEVEL_TRACE)) {
-            msg = '[' + LEVELS[LEVEL_TRACE] + ']' + String.valueOf(msg) + '\n';
-            write(LEVEL_TRACE, String.valueOf(msg));
-        }
-    }
-    
-    /**
-     * Write trace message.
-     */
-    public void trace(Object msg, Throwable t) {
-        if(isEnabled(LEVEL_TRACE)) {
-            msg = '[' + LEVELS[LEVEL_TRACE] + ']' + String.valueOf(msg) + '\n';
-            write(LEVEL_TRACE, String.valueOf(msg));
-            write(LEVEL_TRACE, IoUtils.getStackTrace(t));
-        }
-    }
-    
-    /**
-     * Write debug message.
-     */
-    public void debug(Object msg) {
-        if(isEnabled(LEVEL_DEBUG)) {
-            msg = '[' + LEVELS[LEVEL_DEBUG] + ']' + String.valueOf(msg) + '\n';
-            write(LEVEL_DEBUG, String.valueOf(msg));
-        }
-    }
-    
-    /**
-     * Write debug message.
-     */
-    public void debug(Object msg, Throwable t) {
-        if(isEnabled(LEVEL_DEBUG)) {
-            msg = '[' + LEVELS[LEVEL_DEBUG] + ']' + String.valueOf(msg) + '\n';
-            write(LEVEL_DEBUG, String.valueOf(msg));
-            write(LEVEL_DEBUG, IoUtils.getStackTrace(t));
-        }
-    }
-    
-    /**
-     * Write info message.
-     */
-    public void info(Object msg) {
-        if(isEnabled(LEVEL_INFO)) {
-            msg = '[' + LEVELS[LEVEL_INFO] + ']' + String.valueOf(msg) + '\n';
-            write(LEVEL_INFO, String.valueOf(msg));
-        }
-    }
-    
-    /**
-     * Write info message.
-     */
-    public void info(Object msg, Throwable t) {
-        if(isEnabled(LEVEL_INFO)) {
-            msg = '[' + LEVELS[LEVEL_INFO] + ']' + String.valueOf(msg) + '\n';
-            write(LEVEL_INFO, String.valueOf(msg));
-            write(LEVEL_INFO, IoUtils.getStackTrace(t));
-        }
-    }
-    
-    /**
-     * Write warning message.
-     */
-    public void warn(Object msg) {
-        if(isEnabled(LEVEL_WARN)) {
-            msg = '[' + LEVELS[LEVEL_WARN] + ']' + String.valueOf(msg) + '\n';
-            write(LEVEL_WARN, String.valueOf(msg));
-        }
-    }
-    
-    /**
-     * Write warning message.
-     */
-    public void warn(Object msg, Throwable t) {
-        if(isEnabled(LEVEL_WARN)) {
-            msg = '[' + LEVELS[LEVEL_WARN] + ']' + String.valueOf(msg) + '\n';
-            write(LEVEL_WARN, String.valueOf(msg));
-            write(LEVEL_WARN, IoUtils.getStackTrace(t));
-        }
-    }
-    
-    /**
-     * Write error message.
-     */
-    public void error(Object msg) {
-        if(isEnabled(LEVEL_ERROR)) {
-            msg = '[' + LEVELS[LEVEL_ERROR] + ']' + String.valueOf(msg) + '\n';
-            write(LEVEL_ERROR, String.valueOf(msg));
-        }
-    }
-    
-    /**
-     * Write error message.
-     */
-    public void error(Object msg, Throwable t) {
-        if(isEnabled(LEVEL_ERROR)) {
-            msg = '[' + LEVELS[LEVEL_ERROR] + ']' + String.valueOf(msg) + '\n';
-            write(LEVEL_ERROR, String.valueOf(msg));
-            write(LEVEL_ERROR, IoUtils.getStackTrace(t));
-        }
-    }
-    
-    /**
-     * Write fatal message.
-     */
-    public void fatal(Object msg) {
-        if(isEnabled(LEVEL_FATAL)) {
-            msg = '[' + LEVELS[LEVEL_FATAL] + ']' + String.valueOf(msg) + '\n';
-            write(LEVEL_FATAL, String.valueOf(msg));
-        }
-    }
-    
-    /**
-     * Write fatal message.
-     */
-    public void fatal(Object msg, Throwable t) {
-        if(isEnabled(LEVEL_FATAL)) {
-            msg = '[' + LEVELS[LEVEL_FATAL] + ']' + String.valueOf(msg) + '\n';
-            write(LEVEL_FATAL, String.valueOf(msg));
-            write(LEVEL_FATAL, IoUtils.getStackTrace(t));
-        }
     }
 }

Modified: incubator/ftpserver/trunk/admin-gui/src/test/log4j.properties
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/admin-gui/src/test/log4j.properties?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/admin-gui/src/test/log4j.properties (original)
+++ incubator/ftpserver/trunk/admin-gui/src/test/log4j.properties Sat Feb 24 07:50:22 2007
@@ -18,5 +18,5 @@
 log4j.rootLogger=DEBUG, C 
 log4j.appender.C=org.apache.log4j.ConsoleAppender 
 log4j.appender.C.layout=org.apache.log4j.PatternLayout 
-log4j.appender.C.layout.ConversionPattern=%m%n
+log4j.appender.C.layout.ConversionPattern=[%p] %m%n
 

Modified: incubator/ftpserver/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/pom.xml?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/pom.xml (original)
+++ incubator/ftpserver/trunk/core/pom.xml Sat Feb 24 07:50:22 2007
@@ -39,42 +39,25 @@
       <version>1.0-incubator-SNAPSHOT</version>
     </dependency>
     <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
-      <version>${commons-logging-version}</version>
-      <exclusions>
-        <exclusion>
-          <artifactId>avalon-framework</artifactId>
-          <groupId>avalon-framework</groupId>
-        </exclusion>
-        <exclusion>
-          <artifactId>servlet-api</artifactId>
-          <groupId>javax.servlet</groupId>
-        </exclusion>
-        <exclusion>
-          <artifactId>log4j</artifactId>
-          <groupId>log4j</groupId>
-        </exclusion>
-        <exclusion>
-          <artifactId>logkit</artifactId>
-          <groupId>logkit</groupId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
       <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-jcl</artifactId>
-      <version>1.1.0</version>
+      <artifactId>slf4j-api</artifactId>
+      <version>${slf4j-version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.mina</groupId>
       <artifactId>mina-core</artifactId>
-      <version>1.0.1</version>
+      <version>${mina-version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.mina</groupId>
       <artifactId>mina-filter-ssl</artifactId>
-      <version>1.0.1</version>
+      <version>${mina-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <version>${slf4j-version}</version>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>log4j</groupId>

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/Bean.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/Bean.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/Bean.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/Bean.java Sat Feb 24 07:50:22 2007
@@ -19,13 +19,12 @@
 
 package org.apache.ftpserver;
 
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.ftplet.Component;
 import org.apache.ftpserver.ftplet.Configuration;
 
 public abstract class Bean {
 
-    public static Bean createBean(Configuration config, String defaultClass, LogFactory logFactory) throws Exception {
+    public static Bean createBean(Configuration config, String defaultClass) throws Exception {
         String className = config.getString("class", defaultClass);
         
         Class clazz = Class.forName(className);
@@ -33,9 +32,9 @@
         boolean isComponent = Component.class.isAssignableFrom(clazz);
         
         if(isComponent) {
-            return new ComponentBean(config, clazz, logFactory);
+            return new ComponentBean(config, clazz);
         } else {
-            return new PojoBean(config, clazz, logFactory);
+            return new PojoBean(config, clazz);
         }
     }
     

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ComponentBean.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ComponentBean.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ComponentBean.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ComponentBean.java Sat Feb 24 07:50:22 2007
@@ -19,7 +19,6 @@
 
 package org.apache.ftpserver;
 
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.ftplet.Component;
 import org.apache.ftpserver.ftplet.Configuration;
 
@@ -27,19 +26,16 @@
 
     private Configuration config;
     private Component component;
-    private LogFactory logFactory;
     private Class clazz;
     
-    public ComponentBean(Configuration config, Class clazz, LogFactory logFactory) {
+    public ComponentBean(Configuration config, Class clazz) {
         this.clazz = clazz;
-        this.logFactory = logFactory;
         this.config = config;
     }
     
     public Object initBean() throws Exception {
         component = (Component) clazz.newInstance();
         
-        component.setLogFactory(logFactory);
         component.configure(config);
         return component;
     }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ConfigurableFtpServerContext.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ConfigurableFtpServerContext.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ConfigurableFtpServerContext.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ConfigurableFtpServerContext.java Sat Feb 24 07:50:22 2007
@@ -25,8 +25,6 @@
 import java.util.Map;
 import java.util.StringTokenizer;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.filesystem.NativeFileSystemManager;
 import org.apache.ftpserver.ftplet.Authority;
 import org.apache.ftpserver.ftplet.Configuration;
@@ -52,6 +50,8 @@
 import org.apache.ftpserver.usermanager.PropertiesUserManager;
 import org.apache.ftpserver.usermanager.TransferRatePermission;
 import org.apache.ftpserver.usermanager.WritePermission;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * FTP server configuration implementation. It holds all 
@@ -59,7 +59,8 @@
  */
 public class ConfigurableFtpServerContext implements FtpServerContext {
 
-    private LogFactory logFactory;
+    private static final Logger LOG = LoggerFactory.getLogger(ConfigurableFtpServerContext.class);
+    
     private Bean messageResourceBean;
     private Bean connectionManagerBean;
     private Bean ipRestrictorBean;
@@ -69,7 +70,6 @@
     private Bean statisticsBean;
     private Bean commandFactoryBean;
     
-    private Log log;
     private Map listeners = new HashMap();
     
     private static final Authority[] ADMIN_AUTHORITIES = new Authority[]{
@@ -88,11 +88,6 @@
         
         try {
             
-            // get the log classes
-            logFactory = LogFactory.getFactory();
-            logFactory = new FtpLogFactory(logFactory);
-            log        = logFactory.getInstance(ConfigurableFtpServerContext.class);
-            
             listeners = createListeners(conf, "listeners");
             
             // create all the components
@@ -165,7 +160,7 @@
         try {
             while(st.hasMoreTokens()) {
                 String ftpletName = st.nextToken();
-                log.info("Configuring ftplet : " + ftpletName);
+                LOG.info("Configuring ftplet : " + ftpletName);
                 
                 // get ftplet specific configuration
                 Configuration subConfig = ftpletConf.subset(ftpletName);
@@ -184,7 +179,7 @@
         }
         catch(Exception ex) {
             container.destroy();
-            log.fatal("FtpletContainer.init()", ex);
+            LOG.error("FtpletContainer.init()", ex);
             throw new FtpException("FtpletContainer.init()", ex);
         }
     }
@@ -197,7 +192,7 @@
         // get configuration subset
         Configuration conf = parentConfig.subset(configName);
         
-        Bean bean = Bean.createBean(conf, defaultClass, logFactory);
+        Bean bean = Bean.createBean(conf, defaultClass);
         bean.initBean();
         return bean;
     }
@@ -211,7 +206,7 @@
         // create admin user
         String adminName = userManager.getAdminName();
         if(!userManager.doesExist(adminName)) {
-            log.info("Creating user : " + adminName);
+            LOG.info("Creating user : " + adminName);
             BaseUser adminUser = new BaseUser();
             adminUser.setName(adminName);
             adminUser.setPassword(adminName);
@@ -226,7 +221,7 @@
         
         // create anonymous user
         if(!userManager.doesExist("anonymous")) {
-            log.info("Creating user : anonymous");
+            LOG.info("Creating user : anonymous");
             BaseUser anonUser = new BaseUser();
             anonUser.setName("anonymous");
             anonUser.setPassword("");
@@ -242,13 +237,6 @@
     }
     
     /**
-     * Get the log factory.
-     */
-    public LogFactory getLogFactory() {
-        return logFactory;
-    }
-    
-    /**
      * Get user manager.
      */
     public UserManager getUserManager() {
@@ -348,11 +336,6 @@
         
         if(messageResourceBean != null && messageResourceBean.getBean() != null) {
             messageResourceBean.destroyBean();
-        }
-        
-        if(logFactory != null) {
-            logFactory.release();
-            logFactory = null;
         }
     }
 

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultCommandFactory.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultCommandFactory.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultCommandFactory.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultCommandFactory.java Sat Feb 24 07:50:22 2007
@@ -19,18 +19,16 @@
 
 package org.apache.ftpserver;
 
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ftpserver.command.AbstractCommand;
 import org.apache.ftpserver.ftplet.Component;
 import org.apache.ftpserver.ftplet.Configuration;
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.interfaces.Command;
 import org.apache.ftpserver.interfaces.CommandFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -40,19 +38,10 @@
 public 
 class DefaultCommandFactory implements CommandFactory, Component {
 
-    private LogFactory logFactory;
-    private Log log;
+    private static final  Logger LOG = LoggerFactory.getLogger(DefaultCommandFactory.class);
+
     private HashMap commandMap = new HashMap();  
     
-    
-    /**
-     * Set the log factory.
-     */
-    public void setLogFactory(LogFactory factory) {
-        this.logFactory = factory;
-        log = factory.getInstance(getClass());
-    }
-    
     /**
      * Configure the command factory - populate the command map.
      */
@@ -128,19 +117,8 @@
                 commandMap.put(cmdName, cmd);
             }
             catch(Exception ex) {
-                log.error("DefaultCommandFactory.configure()", ex);
+                LOG.error("DefaultCommandFactory.configure()", ex);
                 throw new FtpException("DefaultCommandFactory.configure()", ex);
-            }
-        }
-        
-        Collection commandEntries = commandMap.values();
-        
-        for (Iterator iter = commandEntries.iterator(); iter.hasNext();) {
-            Command command = (Command) iter.next();
-            
-            if(command instanceof AbstractCommand) {
-                AbstractCommand abstractCommand = (AbstractCommand) command;
-                abstractCommand.setLogFactory(logFactory);
             }
         }
     }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultDataConnectionConfig.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultDataConnectionConfig.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultDataConnectionConfig.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultDataConnectionConfig.java Sat Feb 24 07:50:22 2007
@@ -22,8 +22,6 @@
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.interfaces.DataConnectionConfig;
 import org.apache.ftpserver.interfaces.Ssl;
 
@@ -91,21 +89,9 @@
         }
     }
     
-    private Log log;
-    private LogFactory logFactory;
-    
     private int maxIdleTimeMillis = 10000;
     
     private Ssl ssl;
-
-    
-    /**
-     * Set the log factory. 
-     */
-    public void setLogFactory(LogFactory factory) {
-        logFactory = factory;
-        log = logFactory.getInstance(getClass());
-    }
     
     public void setIdleTime(int idleTime) {
         // get the maximum idle time in millis

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultFtpServerContext.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultFtpServerContext.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultFtpServerContext.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultFtpServerContext.java Sat Feb 24 07:50:22 2007
@@ -24,8 +24,6 @@
 import java.util.Iterator;
 import java.util.Map;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.filesystem.NativeFileSystemManager;
 import org.apache.ftpserver.ftplet.Authority;
 import org.apache.ftpserver.ftplet.Component;
@@ -51,6 +49,8 @@
 import org.apache.ftpserver.usermanager.PropertiesUserManager;
 import org.apache.ftpserver.usermanager.TransferRatePermission;
 import org.apache.ftpserver.usermanager.WritePermission;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * FTP server configuration implementation. It holds all 
@@ -58,7 +58,8 @@
  */
 public class DefaultFtpServerContext implements FtpServerContext {
 
-    private LogFactory logFactory;
+    private static final Logger LOG = LoggerFactory.getLogger(DefaultFtpServerContext.class);
+    
     private MessageResource messageResource;
     private ConnectionManager connectionManager;
     private IpRestrictor ipRestrictor;
@@ -68,7 +69,6 @@
     private FtpStatistics statistics;
     private CommandFactory commandFactory;
     
-    private Log log;
     private Map listeners = new HashMap();
     
     private static final Authority[] ADMIN_AUTHORITIES = new Authority[]{
@@ -90,12 +90,6 @@
     public DefaultFtpServerContext(boolean createDefaultUsers) throws Exception {
         
         try {
-            
-            // get the log classes
-            logFactory = LogFactory.getFactory();
-            logFactory = new FtpLogFactory(logFactory);
-            log        = logFactory.getInstance(DefaultFtpServerContext.class);
-            
             createListeners();
             
             // create all the components
@@ -148,7 +142,7 @@
         // create admin user
         String adminName = userManager.getAdminName();
         if(!userManager.doesExist(adminName)) {
-            log.info("Creating user : " + adminName);
+            LOG.info("Creating user : " + adminName);
             BaseUser adminUser = new BaseUser();
             adminUser.setName(adminName);
             adminUser.setPassword(adminName);
@@ -163,7 +157,7 @@
         
         // create anonymous user
         if(!userManager.doesExist("anonymous")) {
-            log.info("Creating user : anonymous");
+            LOG.info("Creating user : anonymous");
             BaseUser anonUser = new BaseUser();
             anonUser.setName("anonymous");
             anonUser.setPassword("");
@@ -179,13 +173,6 @@
     }
     
     /**
-     * Get the log factory.
-     */
-    public LogFactory getLogFactory() {
-        return logFactory;
-    }
-    
-    /**
      * Get user manager.
      */
     public UserManager getUserManager() {
@@ -289,11 +276,6 @@
         
         if(messageResource != null && messageResource instanceof Component) {
             ((Component)messageResource).dispose();
-        }
-        
-        if(logFactory != null) {
-            logFactory.release();
-            logFactory = null;
         }
     }
 

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpDataConnectionFactory.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpDataConnectionFactory.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpDataConnectionFactory.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpDataConnectionFactory.java Sat Feb 24 07:50:22 2007
@@ -25,11 +25,12 @@
 
 import javax.net.ssl.SSLSocket;
 
-import org.apache.commons.logging.Log;
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.interfaces.DataConnectionConfig;
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.interfaces.Ssl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -39,7 +40,7 @@
 public
 class FtpDataConnectionFactory {
     
-    private Log log;
+    private static final Logger LOG = LoggerFactory.getLogger(FtpDataConnectionFactory.class);
     
     private FtpServerContext    serverContext;
     private Socket        dataSoc;
@@ -63,7 +64,6 @@
     public FtpDataConnectionFactory(FtpServerContext serverContext, FtpSessionImpl session) {
         this.session = session;
         this.serverContext = serverContext;
-        log = serverContext.getLogFactory().getInstance(getClass());
         
     }
 
@@ -79,7 +79,7 @@
                 dataSoc.close(); 
             } 
             catch(Exception ex) {
-                log.warn("FtpDataConnection.closeDataSocket()", ex);
+                LOG.warn("FtpDataConnection.closeDataSocket()", ex);
             }
             dataSoc = null;
         }
@@ -90,7 +90,7 @@
                servSoc.close();
             }
             catch(Exception ex) {
-                log.warn("FtpDataConnection.closeDataSocket()", ex);
+                LOG.warn("FtpDataConnection.closeDataSocket()", ex);
             }
             
             FtpServerContext ctx = serverContext;
@@ -136,7 +136,7 @@
         // get the passive port
         int passivePort = session.getListener().getDataConnectionConfig().getPassivePort();
         if(passivePort == -1) {
-            log.warn("Cannot find an available passive port.");
+            LOG.warn("Cannot find an available passive port.");
             servSoc = null;
             return false;
         }
@@ -171,7 +171,7 @@
         catch(Exception ex) {
             servSoc = null;
             closeDataSocket();
-            log.warn("FtpDataConnection.setPasvCommand()", ex);
+            LOG.warn("FtpDataConnection.setPasvCommand()", ex);
         }
         return bRet;
     }
@@ -239,7 +239,7 @@
         }
         catch(Exception ex) {
             closeDataSocket();
-            log.warn("FtpDataConnection.getDataSocket()", ex);
+            LOG.warn("FtpDataConnection.getDataSocket()", ex);
             throw ex;
         }
         

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpServer.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpServer.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpServer.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpServer.java Sat Feb 24 07:50:22 2007
@@ -20,9 +20,10 @@
 package org.apache.ftpserver;
 
 
-import org.apache.commons.logging.Log;
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.listener.Listener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * This is the starting point of all the servers. It invokes a new listener
@@ -31,12 +32,12 @@
  */
 public class FtpServer {
 
+    private static final Logger LOG = LoggerFactory.getLogger(FtpServer.class);
+    
     private Thread runner;
 
     private FtpServerContext serverContext = new DefaultFtpServerContext();
 
-    private Log log;
-
     private boolean suspended;
 
     /**
@@ -44,7 +45,6 @@
      * @throws Exception 
      */
     public FtpServer() throws Exception {
-        log = this.serverContext.getLogFactory().getInstance(getClass());
     }
 
     /**
@@ -53,7 +53,6 @@
      */
     public FtpServer(FtpServerContext serverContext) throws Exception {
         this.serverContext = serverContext;
-        log = this.serverContext.getLogFactory().getInstance(getClass());
     }
 
     /**
@@ -66,7 +65,7 @@
         }
         
         System.out.println("Server ready :: Apache FTP Server");
-        log.info("------- Apache FTP Server started ------");
+        LOG.info("------- Apache FTP Server started ------");
 
     }
     

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpStatisticsImpl.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpStatisticsImpl.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpStatisticsImpl.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpStatisticsImpl.java Sat Feb 24 07:50:22 2007
@@ -23,7 +23,6 @@
 import java.util.Date;
 import java.util.Hashtable;
 
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.ftplet.Component;
 import org.apache.ftpserver.ftplet.Configuration;
 import org.apache.ftpserver.ftplet.FileObject;
@@ -71,13 +70,6 @@
     Hashtable userLoginTable = new Hashtable();
     
     public static final String LOGIN_NUMBER = "login_number";
-    
-    
-    /**
-     * Set the log factory - does nothing.
-     */
-    public void setLogFactory(LogFactory factory) {
-    }
     
     /**
      * Configure component - does nothing.

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpWriter.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpWriter.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpWriter.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpWriter.java Sat Feb 24 07:50:22 2007
@@ -19,7 +19,6 @@
 
 package org.apache.ftpserver;
 
-import org.apache.commons.logging.Log;
 import org.apache.ftpserver.ftplet.FtpReplyOutput;
 import org.apache.ftpserver.listener.ConnectionObserver;
 
@@ -28,7 +27,6 @@
  */
 public abstract class FtpWriter implements FtpReplyOutput {
 
-    protected Log log;
     private ConnectionObserver observer;
     
     

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/PojoBean.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/PojoBean.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/PojoBean.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/PojoBean.java Sat Feb 24 07:50:22 2007
@@ -20,9 +20,6 @@
 
 package org.apache.ftpserver;
 
-import java.lang.reflect.InvocationTargetException;
-
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.ftplet.Configuration;
 import org.apache.ftpserver.util.ClassUtils;
 
@@ -30,36 +27,20 @@
 
     private Configuration config;
     private Object pojo;
-    private LogFactory logFactory;
     private Class clazz;
     
-    public PojoBean(Configuration config, Class clazz, LogFactory logFactory) {
+    public PojoBean(Configuration config, Class clazz) {
         this.clazz = clazz;
-        this.logFactory = logFactory;
         this.config = config;
     }
     
     public Object initBean() throws Exception {
         pojo = ClassUtils.createBean(config, clazz.getName());
         
-        setLogFactory();
-        
         configure();
         
         return pojo;
         
-    }
-
-    /**
-     * @throws IllegalAccessException
-     * @throws InvocationTargetException
-     */
-    private void setLogFactory() throws Exception {
-        if(logFactory == null) {
-            return;
-        }
-        
-        ClassUtils.setProperty(pojo, "logFactory", logFactory);
     }
     
     private void configure() throws Exception {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/APPE.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/APPE.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/APPE.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/APPE.java Sat Feb 24 07:50:22 2007
@@ -23,7 +23,6 @@
 import java.io.OutputStream;
 import java.net.SocketException;
 
-import org.apache.commons.logging.Log;
 import org.apache.ftpserver.FtpDataConnection;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.ftplet.FileObject;
@@ -38,6 +37,8 @@
 import org.apache.ftpserver.listener.Connection;
 import org.apache.ftpserver.util.FtpReplyUtil;
 import org.apache.ftpserver.util.IoUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <code>APPE &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -52,6 +53,8 @@
 public 
 class APPE extends AbstractCommand {
     
+    private static final Logger LOG = LoggerFactory.getLogger(APPE.class);
+    
     /**
      * Execute command.
      */
@@ -79,7 +82,7 @@
             try {
                 ftpletRet = ftpletContainer.onAppendStart(session, request, out);
             } catch(Exception e) {
-                log.debug("Ftplet container threw exception", e);
+                LOG.debug("Ftplet container threw exception", e);
                 ftpletRet = FtpletEnum.RET_DISCONNECT;
             }
             if(ftpletRet == FtpletEnum.RET_SKIP) {
@@ -96,7 +99,7 @@
                 file = session.getFileSystemView().getFileObject(fileName);
             }
             catch(Exception e) {
-                log.debug("File system threw exception", e);
+                LOG.debug("File system threw exception", e);
             }
             if(file == null) {
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "APPE.invalid", fileName));
@@ -123,7 +126,7 @@
             try {
                 dataConnection = session.getFtpDataConnection().openConnection();
             } catch (Exception e) {
-                log.debug("Exception when getting data input stream", e);
+                LOG.debug("Exception when getting data input stream", e);
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_425_CANT_OPEN_DATA_CONNECTION, "APPE", fileName));
                 return;
             }
@@ -147,20 +150,20 @@
                 
                 // log message
                 String userName = session.getUser().getName();
-                Log log = serverContext.getLogFactory().getInstance(getClass());
-                log.info("File upload : " + userName + " - " + fileName);
+
+                LOG.info("File upload : " + userName + " - " + fileName);
                 
                 // notify the statistics component
                 ServerFtpStatistics ftpStat = (ServerFtpStatistics)serverContext.getFtpStatistics();
                 ftpStat.setUpload(connection, file, transSz);
             }
             catch(SocketException e) {
-                log.debug("SocketException during file upload", e);
+                LOG.debug("SocketException during file upload", e);
                 failure = true;
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_426_CONNECTION_CLOSED_TRANSFER_ABORTED, "APPE", fileName));
             }
             catch(IOException e) {
-                log.debug("IOException during file upload", e);
+                LOG.debug("IOException during file upload", e);
                 failure = true;
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN, "APPE", fileName));
             }
@@ -176,7 +179,7 @@
                 try {
                     ftpletRet = ftpletContainer.onAppendEnd(session, request, out);
                 } catch(Exception e) {
-                    log.debug("Ftplet container threw exception", e);
+                    LOG.debug("Ftplet container threw exception", e);
                     ftpletRet = FtpletEnum.RET_DISCONNECT;
                 }
                 if(ftpletRet == FtpletEnum.RET_DISCONNECT) {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/AUTH.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/AUTH.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/AUTH.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/AUTH.java Sat Feb 24 07:50:22 2007
@@ -21,22 +21,23 @@
 
 import java.io.IOException;
 
-import org.apache.commons.logging.Log;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.ftplet.FtpReply;
 import org.apache.ftpserver.ftplet.FtpReplyOutput;
 import org.apache.ftpserver.ftplet.FtpRequest;
-import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.listener.Connection;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * This server supports explicit SSL support.
  */
 public 
 class AUTH extends AbstractCommand {
-    
+
+    private static final Logger LOG = LoggerFactory.getLogger(AUTH.class);
 
     /**
      * Execute command
@@ -56,8 +57,6 @@
         }
         
         // check SSL configuration
-        FtpServerContext serverContext = connection.getServerContext();
-        Log log = serverContext.getLogFactory().getInstance(getClass());
         if(session.getListener().getSsl() == null) {
             out.write(FtpReplyUtil.translate(session, 431, "AUTH", null));
             return;
@@ -73,7 +72,7 @@
             } catch(FtpException ex) {
                 throw ex;
             } catch(Exception ex) {
-                log.warn("AUTH.execute()", ex);
+                LOG.warn("AUTH.execute()", ex);
                 throw new FtpException("AUTH.execute()", ex);
             }
         }
@@ -85,7 +84,7 @@
             } catch(FtpException ex) {
                 throw ex;
             } catch(Exception ex) {
-                log.warn("AUTH.execute()", ex);
+                LOG.warn("AUTH.execute()", ex);
                 throw new FtpException("AUTH.execute()", ex);
             }
         }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/AbstractCommand.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/AbstractCommand.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/AbstractCommand.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/AbstractCommand.java Sat Feb 24 07:50:22 2007
@@ -19,8 +19,6 @@
 
 package org.apache.ftpserver.command;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.interfaces.Command;
 
 /**
@@ -28,13 +26,5 @@
  */
 public abstract class AbstractCommand implements Command {
 
-    protected Log log;
     
-    public AbstractCommand() {
-        log = LogFactory.getLog(getClass());
-    }
-
-    public void setLogFactory(LogFactory logFactory) {
-        log = logFactory.getInstance(getClass());
-    }  
 }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CDUP.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CDUP.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CDUP.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CDUP.java Sat Feb 24 07:50:22 2007
@@ -29,6 +29,8 @@
 import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.listener.Connection;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <code>CDUP &lt;CRLF&gt;</code><br>
@@ -42,6 +44,8 @@
 public 
 class CDUP extends AbstractCommand {
 
+    private static final Logger LOG = LoggerFactory.getLogger(CDUP.class);
+    
     /**
      * Execute command.
      */
@@ -60,7 +64,7 @@
             success = fsview.changeDirectory("..");
         }
         catch(Exception ex) {
-            log.debug("Failed to change directory in file system", ex);
+            LOG.debug("Failed to change directory in file system", ex);
         }
         if(success) {
             String dirName = fsview.getCurrentDirectory().getFullName();

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CWD.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CWD.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CWD.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CWD.java Sat Feb 24 07:50:22 2007
@@ -29,6 +29,8 @@
 import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.listener.Connection;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <code>CWD  &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -42,6 +44,8 @@
 public 
 class CWD extends AbstractCommand {
 
+    private static final Logger LOG = LoggerFactory.getLogger(CWD.class);
+    
     /**
      * Execute command
      */
@@ -66,7 +70,7 @@
             success = fsview.changeDirectory(dirName);
         }
         catch(Exception ex) {
-            log.debug("Failed to change directory in file system", ex);
+            LOG.debug("Failed to change directory in file system", ex);
         }
         if(success) {
             dirName = fsview.getCurrentDirectory().getFullName();

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/DELE.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/DELE.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/DELE.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/DELE.java Sat Feb 24 07:50:22 2007
@@ -21,7 +21,6 @@
 
 import java.io.IOException;
 
-import org.apache.commons.logging.Log;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.ftplet.FileObject;
 import org.apache.ftpserver.ftplet.FtpException;
@@ -34,6 +33,8 @@
 import org.apache.ftpserver.interfaces.ServerFtpStatistics;
 import org.apache.ftpserver.listener.Connection;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <code>DELE &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -44,7 +45,8 @@
 public 
 class DELE extends AbstractCommand {
     
-
+    private static final Logger LOG = LoggerFactory.getLogger(DELE.class);
+    
     /**
      * Execute command.
      */
@@ -70,7 +72,7 @@
         try {
             ftpletRet = ftpletContainer.onDeleteStart(session, request, out);
         } catch(Exception e) {
-            log.debug("Ftplet container threw exception", e);
+            LOG.debug("Ftplet container threw exception", e);
             ftpletRet = FtpletEnum.RET_DISCONNECT;
         }
         if(ftpletRet == FtpletEnum.RET_SKIP) {
@@ -89,7 +91,7 @@
             file = session.getFileSystemView().getFileObject(fileName);
         }
         catch(Exception ex) {
-            log.debug("Could not get file " + fileName, ex);
+            LOG.debug("Could not get file " + fileName, ex);
         }
         if(file == null) {
             out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "DELE.invalid", fileName));
@@ -110,8 +112,8 @@
             
             // log message
             String userName = session.getUser().getName();
-            Log log = serverContext.getLogFactory().getInstance(getClass());
-            log.info("File delete : " + userName + " - " + fileName);
+            
+            LOG.info("File delete : " + userName + " - " + fileName);
             
             // notify statistics object
             ServerFtpStatistics ftpStat = (ServerFtpStatistics)serverContext.getFtpStatistics();
@@ -121,7 +123,7 @@
             try{
                 ftpletRet = ftpletContainer.onDeleteEnd(session, request, out);
             } catch(Exception e) {
-                log.debug("Ftplet container threw exception", e);
+                LOG.debug("Ftplet container threw exception", e);
                 ftpletRet = FtpletEnum.RET_DISCONNECT;
             }
             if(ftpletRet == FtpletEnum.RET_DISCONNECT) {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/EPRT.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/EPRT.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/EPRT.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/EPRT.java Sat Feb 24 07:50:22 2007
@@ -30,6 +30,8 @@
 import org.apache.ftpserver.interfaces.DataConnectionConfig;
 import org.apache.ftpserver.listener.Connection;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * The EPRT command allows for the specification of an extended address
@@ -42,6 +44,8 @@
 public 
 class EPRT extends AbstractCommand {
 
+    private static final Logger LOG = LoggerFactory.getLogger(EPRT.class);
+    
     /**
      * Execute command.
      */
@@ -77,7 +81,7 @@
             port = arg.substring(lastDelimIdx+1, arg.length() - 1);
         }
         catch(Exception ex) {
-            log.debug("Exception parsing host and port: " + arg, ex);
+            LOG.debug("Exception parsing host and port: " + arg, ex);
             out.write(FtpReplyUtil.translate(session, 510, "EPRT", null));
             return;
         }
@@ -88,7 +92,7 @@
             dataAddr = InetAddress.getByName(host);
         }
         catch(UnknownHostException ex) {
-            log.debug("Unknown host: " + host, ex);
+            LOG.debug("Unknown host: " + host, ex);
             out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_553_REQUESTED_ACTION_NOT_TAKEN_FILE_NAME_NOT_ALLOWED, "EPRT.host", null));
             return;
         }
@@ -108,7 +112,7 @@
             dataPort = Integer.parseInt(port);     
         }
         catch(NumberFormatException ex) {
-            log.debug("Invalid port: " + port, ex);
+            LOG.debug("Invalid port: " + port, ex);
             out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_552_REQUESTED_FILE_ACTION_ABORTED_EXCEEDED_STORAGE, "EPRT.invalid", null)); 
             return; 
         }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/LIST.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/LIST.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/LIST.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/LIST.java Sat Feb 24 07:50:22 2007
@@ -34,6 +34,8 @@
 import org.apache.ftpserver.listing.ListArgument;
 import org.apache.ftpserver.listing.ListArgumentParser;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <code>LIST [&lt;SP&gt; &lt;pathname&gt;] &lt;CRLF&gt;</code><br>
@@ -50,6 +52,8 @@
 public 
 class LIST extends AbstractCommand {
     
+    private static final Logger LOG = LoggerFactory.getLogger(LIST.class);
+    
     private static final LISTFileFormater LIST_FILE_FORMATER = new LISTFileFormater();
     private DirectoryLister directoryLister = new DirectoryLister();
     
@@ -73,7 +77,7 @@
             try {
                 dataConnection = session.getFtpDataConnection().openConnection();
             } catch (Exception e) {
-                log.debug("Exception getting the output data stream", e);
+                LOG.debug("Exception getting the output data stream", e);
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_425_CANT_OPEN_DATA_CONNECTION, "LIST", null));
                 return;
             }
@@ -89,16 +93,16 @@
                 dataConnection.transferToClient(directoryLister.listFiles(parsedArg, session.getFileSystemView(), LIST_FILE_FORMATER));
             }
             catch(SocketException ex) {
-                log.debug("Socket exception during list transfer", ex);
+                LOG.debug("Socket exception during list transfer", ex);
                 failure = true;
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_426_CONNECTION_CLOSED_TRANSFER_ABORTED, "LIST", null));
             }
             catch(IOException ex) {
-                log.debug("IOException during list transfer", ex);
+                LOG.debug("IOException during list transfer", ex);
                 failure = true;
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN, "LIST", null));
             } catch(IllegalArgumentException e) {
-                log.debug("Illegal list syntax: " + request.getArgument(), e);
+                LOG.debug("Illegal list syntax: " + request.getArgument(), e);
                 // if listing syntax error - send message
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "LIST", null));
             }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MD5.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MD5.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MD5.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MD5.java Sat Feb 24 07:50:22 2007
@@ -33,6 +33,8 @@
 import org.apache.ftpserver.listener.Connection;
 import org.apache.ftpserver.util.FtpReplyUtil;
 import org.apache.ftpserver.util.IoUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <code>MD5 &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -45,6 +47,8 @@
 public 
 class MD5 extends AbstractCommand {
 
+    private static final Logger LOG = LoggerFactory.getLogger(MD5.class);
+    
     /**
      * Execute command.
      */
@@ -88,7 +92,7 @@
                 file = session.getFileSystemView().getFileObject(fileName);
             }
             catch(Exception ex) {
-                log.debug("Exception getting the file object: " + fileName, ex);
+                LOG.debug("Exception getting the file object: " + fileName, ex);
             }
             
             if(file == null) {
@@ -116,7 +120,7 @@
                 sb.append(md5Hash);
                 
             } catch(NoSuchAlgorithmException e) {
-                log.debug("MD5 algorithm not available", e);
+                LOG.debug("MD5 algorithm not available", e);
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_502_COMMAND_NOT_IMPLEMENTED, "MD5.notimplemened", null));
             } finally {
                 IoUtils.close(is);

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MDTM.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MDTM.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MDTM.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MDTM.java Sat Feb 24 07:50:22 2007
@@ -30,6 +30,8 @@
 import org.apache.ftpserver.listener.Connection;
 import org.apache.ftpserver.util.DateUtils;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <code>MDTM &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -39,6 +41,8 @@
 public 
 class MDTM extends AbstractCommand {
 
+    private static final Logger LOG = LoggerFactory.getLogger(MDTM.class);
+    
     /**
      * Execute command
      */
@@ -63,7 +67,7 @@
             file = session.getFileSystemView().getFileObject(fileName);
         }
         catch(Exception ex) {
-            log.debug("Exception getting file object", ex);
+            LOG.debug("Exception getting file object", ex);
         }
         if(file == null) {
             out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "MDTM", fileName));

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MKD.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MKD.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MKD.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MKD.java Sat Feb 24 07:50:22 2007
@@ -21,7 +21,6 @@
 
 import java.io.IOException;
 
-import org.apache.commons.logging.Log;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.ftplet.FileObject;
 import org.apache.ftpserver.ftplet.FtpException;
@@ -34,6 +33,8 @@
 import org.apache.ftpserver.interfaces.ServerFtpStatistics;
 import org.apache.ftpserver.listener.Connection;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <code>MKD  &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -46,6 +47,7 @@
 public 
 class MKD extends AbstractCommand {
     
+    private static final Logger LOG = LoggerFactory.getLogger(MKD.class);
 
     /**
      * Execute command.
@@ -72,7 +74,7 @@
         try{
             ftpletRet = ftpletContainer.onMkdirStart(session, request, out);
         } catch(Exception e) {
-            log.debug("Ftplet container threw exception", e);
+            LOG.debug("Ftplet container threw exception", e);
             ftpletRet = FtpletEnum.RET_DISCONNECT;
         }
         if(ftpletRet == FtpletEnum.RET_SKIP) {
@@ -89,7 +91,7 @@
             file = session.getFileSystemView().getFileObject(fileName);
         }
         catch(Exception ex) {
-            log.debug("Exception getting file object", ex);
+            LOG.debug("Exception getting file object", ex);
         }
         if(file == null) {
             out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "MKD.invalid", fileName));
@@ -115,8 +117,7 @@
             
             // write log message
             String userName = session.getUser().getName();
-            Log log = serverContext.getLogFactory().getInstance(getClass());
-            log.info("Directory create : " + userName + " - " + fileName);
+            LOG.info("Directory create : " + userName + " - " + fileName);
             
             // notify statistics object
             ServerFtpStatistics ftpStat = (ServerFtpStatistics)connection.getServerContext().getFtpStatistics();
@@ -126,7 +127,7 @@
             try{
                 ftpletRet = ftpletContainer.onMkdirEnd(session, request, out);
             } catch(Exception e) {
-                log.debug("Ftplet container threw exception", e);
+                LOG.debug("Ftplet container threw exception", e);
                 ftpletRet = FtpletEnum.RET_DISCONNECT;
             }
             if(ftpletRet == FtpletEnum.RET_DISCONNECT) {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLSD.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLSD.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLSD.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLSD.java Sat Feb 24 07:50:22 2007
@@ -35,6 +35,8 @@
 import org.apache.ftpserver.listing.ListArgumentParser;
 import org.apache.ftpserver.listing.MLSTFileFormater;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <code>MLSD [&lt;SP&gt; &lt;pathname&gt;] &lt;CRLF&gt;</code><br>
@@ -47,7 +49,9 @@
  */
 public 
 class MLSD extends AbstractCommand {
-
+    
+    private static final Logger LOG = LoggerFactory.getLogger(MLSD.class);
+    
     private DirectoryLister directoryLister = new DirectoryLister();
     
     /**
@@ -72,7 +76,7 @@
             try {
                 dataConnection = session.getFtpDataConnection().openConnection();
             } catch (Exception e) {
-                log.debug("Exception getting the output data stream", e);
+                LOG.debug("Exception getting the output data stream", e);
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_425_CANT_OPEN_DATA_CONNECTION, "MLSD", null));
                 return;
             }
@@ -87,16 +91,16 @@
                 dataConnection.transferToClient(directoryLister.listFiles(parsedArg, session.getFileSystemView(), formater));
             }
             catch(SocketException ex) {
-                log.debug("Socket exception during data transfer", ex);
+                LOG.debug("Socket exception during data transfer", ex);
                 failure = true;
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_426_CONNECTION_CLOSED_TRANSFER_ABORTED, "MLSD", null));
             }
             catch(IOException ex) {
-                log.debug("IOException during data transfer", ex);
+                LOG.debug("IOException during data transfer", ex);
                 failure = true;
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN, "MLSD", null));
             } catch(IllegalArgumentException e) {
-                log.debug("Illegal listing syntax: " + request.getArgument(), e);
+                LOG.debug("Illegal listing syntax: " + request.getArgument(), e);
                 // if listing syntax error - send message
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "MLSD", null));
             }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLST.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLST.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLST.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLST.java Sat Feb 24 07:50:22 2007
@@ -33,6 +33,8 @@
 import org.apache.ftpserver.listing.ListArgumentParser;
 import org.apache.ftpserver.listing.MLSTFileFormater;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <code>MLST &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -42,6 +44,8 @@
 public 
 class MLST extends AbstractCommand {
 
+    private static final Logger LOG = LoggerFactory.getLogger(MLST.class);
+    
     /**
      * Execute command.
      */
@@ -67,7 +71,7 @@
             }
         }
         catch(FtpException ex) {
-            log.debug("Exception sending the file listing", ex);
+            LOG.debug("Exception sending the file listing", ex);
             out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "MLST", null));
         }     
     }   

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NLST.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NLST.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NLST.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NLST.java Sat Feb 24 07:50:22 2007
@@ -36,6 +36,8 @@
 import org.apache.ftpserver.listing.ListArgumentParser;
 import org.apache.ftpserver.listing.NLSTFileFormater;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <code>NLST [&lt;SP&gt; &lt;pathname&gt;] &lt;CRLF&gt;</code><br>
@@ -50,6 +52,8 @@
 public 
 class NLST extends AbstractCommand {
 
+    private static final Logger LOG = LoggerFactory.getLogger(NLST.class);
+    
     private static final NLSTFileFormater NLST_FILE_FORMATER = new NLSTFileFormater();
     private static final LISTFileFormater LIST_FILE_FORMATER = new LISTFileFormater();
     private DirectoryLister directoryLister = new DirectoryLister();
@@ -76,7 +80,7 @@
             try {
                 dataConnection = session.getFtpDataConnection().openConnection();
             } catch (Exception e) {
-                log.debug("Exception getting the output data stream", e);
+                LOG.debug("Exception getting the output data stream", e);
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_425_CANT_OPEN_DATA_CONNECTION, "NLST", null));
                 return;
             }
@@ -96,16 +100,16 @@
                 dataConnection.transferToClient(directoryLister.listFiles(parsedArg, session.getFileSystemView(), formater));
             }
             catch(SocketException ex) {
-                log.debug("Socket exception during data transfer", ex);
+                LOG.debug("Socket exception during data transfer", ex);
                 failure = true;
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_426_CONNECTION_CLOSED_TRANSFER_ABORTED, "NLST", null));
             }
             catch(IOException ex) {
-                log.debug("IOException during data transfer", ex);
+                LOG.debug("IOException during data transfer", ex);
                 failure = true;
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN, "NLST", null));
             } catch(IllegalArgumentException e) {
-                log.debug("Illegal listing syntax: " + request.getArgument(), e);
+                LOG.debug("Illegal listing syntax: " + request.getArgument(), e);
                 // if listing syntax error - send message
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "LIST", null));
             }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/OPTS.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/OPTS.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/OPTS.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/OPTS.java Sat Feb 24 07:50:22 2007
@@ -30,6 +30,8 @@
 import org.apache.ftpserver.interfaces.Command;
 import org.apache.ftpserver.listener.Connection;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -41,6 +43,8 @@
 public 
 class OPTS extends AbstractCommand {
 
+    private static final Logger LOG = LoggerFactory.getLogger(OPTS.class);
+    
     private static final HashMap COMMAND_MAP = new HashMap(16);
     
     
@@ -82,7 +86,7 @@
             }
         }
         catch(Exception ex) {
-            log.warn("OPTS.execute()", ex);
+            LOG.warn("OPTS.execute()", ex);
             session.resetState();
             out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_500_SYNTAX_ERROR_COMMAND_UNRECOGNIZED, "OPTS", null));
         }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASS.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASS.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASS.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASS.java Sat Feb 24 07:50:22 2007
@@ -21,7 +21,6 @@
 
 import java.io.IOException;
 
-import org.apache.commons.logging.Log;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.ftplet.Authentication;
 import org.apache.ftpserver.ftplet.AuthenticationFailedException;
@@ -43,6 +42,8 @@
 import org.apache.ftpserver.usermanager.UserMetadata;
 import org.apache.ftpserver.usermanager.UsernamePasswordAuthentication;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <code>PASS &lt;SP&gt; <password> &lt;CRLF&gt;</code><br>
@@ -54,6 +55,8 @@
 public 
 class PASS extends AbstractCommand {
     
+    private static final Logger LOG = LoggerFactory.getLogger(PASS.class);
+    
     /**
      * Execute command.
      */
@@ -64,7 +67,7 @@
     
         boolean success = false;
         FtpServerContext serverContext = connection.getServerContext();
-        Log log = serverContext.getLogFactory().getInstance(getClass());
+        
         ConnectionManager conManager = serverContext.getConnectionManager();
         ServerFtpStatistics stat = (ServerFtpStatistics)serverContext.getFtpStatistics();
         try {
@@ -131,12 +134,12 @@
             } catch(AuthenticationFailedException e) { 
                 success = false;
                 authenticatedUser = null;
-                log.warn("User failed to log in", e);                
+                LOG.warn("User failed to log in", e);                
             }
             catch(Exception e) {
                 success = false;
                 authenticatedUser = null;
-                log.warn("PASS.execute()", e);
+                LOG.warn("PASS.execute()", e);
             }
 
             // set the user so that the Ftplets will be able to verify it
@@ -162,7 +165,7 @@
                 try{
                     ftpletRet = ftpletContainer.onLogin(session, request, out);
                 } catch(Exception e) {
-                    log.debug("Ftplet container threw exception", e);
+                    LOG.debug("Ftplet container threw exception", e);
                     ftpletRet = FtpletEnum.RET_DISCONNECT;
                 }
                 if(ftpletRet == FtpletEnum.RET_DISCONNECT) {
@@ -179,7 +182,7 @@
                 session.setUserArgument(oldUserArgument);
                 session.setMaxIdleTime(oldMaxIdleTime);
                 
-                log.warn("Login failure - " + userName);
+                LOG.warn("Login failure - " + userName);
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_530_NOT_LOGGED_IN, "PASS", userName));
                 stat.setLoginFail(connection);
                 return;
@@ -194,10 +197,10 @@
             // everything is fine - send login ok message
             out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_230_USER_LOGGED_IN, "PASS", userName));
             if(anonymous) {
-                log.info("Anonymous login success - " + password);
+                LOG.info("Anonymous login success - " + password);
             }
             else {
-                log.info("Login success - " + userName);
+                LOG.info("Login success - " + userName);
             }
             
         }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PORT.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PORT.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PORT.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PORT.java Sat Feb 24 07:50:22 2007
@@ -31,6 +31,8 @@
 import org.apache.ftpserver.interfaces.DataConnectionConfig;
 import org.apache.ftpserver.listener.Connection;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <code>PORT &lt;SP&gt; <host-port> &lt;CRLF&gt;</code><br>
@@ -53,6 +55,8 @@
 public 
 class PORT extends AbstractCommand {
 
+    private static final Logger LOG = LoggerFactory.getLogger(PORT.class);
+    
     /**
      * Execute command.
      */
@@ -91,7 +95,7 @@
             dataAddr = InetAddress.getByName(dataSrvName);
         }
         catch(UnknownHostException ex) {
-            log.debug("Unknown host: " + dataSrvName, ex);
+            LOG.debug("Unknown host: " + dataSrvName, ex);
             out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_553_REQUESTED_ACTION_NOT_TAKEN_FILE_NAME_NOT_ALLOWED, "PORT.host", null));
             return;
         }
@@ -113,7 +117,7 @@
             dataPort = (hi << 8) | lo;     
         }
         catch(NumberFormatException ex) {
-            log.debug("Invalid data port: " + request.getArgument(), ex);
+            LOG.debug("Invalid data port: " + request.getArgument(), ex);
             out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_552_REQUESTED_FILE_ACTION_ABORTED_EXCEEDED_STORAGE, "PORT.invalid", null)); 
             return; 
         }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/REST.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/REST.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/REST.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/REST.java Sat Feb 24 07:50:22 2007
@@ -27,6 +27,8 @@
 import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.listener.Connection;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <code>REST &lt;SP&gt; <marker> &lt;CRLF&gt;</code><br>
@@ -41,6 +43,8 @@
 public 
 class REST extends AbstractCommand {
 
+    private static final Logger LOG = LoggerFactory.getLogger(REST.class);
+    
     /**
      * Execute command
      */
@@ -72,7 +76,7 @@
             }
         }
         catch(NumberFormatException ex) {
-            log.debug("Invalid restart position: " + argument, ex);
+            LOG.debug("Invalid restart position: " + argument, ex);
             out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "REST.invalid", null)); 
         }
         



Mime
View raw message