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 [2/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
Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RETR.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RETR.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RETR.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RETR.java Sat Feb 24 07:50:22 2007
@@ -39,6 +39,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>RETR &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -51,6 +53,7 @@
 public 
 class RETR extends AbstractCommand {
     
+    private static final Logger LOG = LoggerFactory.getLogger(RETR.class);
 
     /**
      * Execute command.
@@ -79,7 +82,7 @@
             try {
                 ftpletRet = ftpletContainer.onDownloadStart(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 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, "RETR.missing", fileName));
@@ -134,7 +137,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, "RETR", null));
                 return;
             }
@@ -149,7 +152,7 @@
                 
                 // log message
                 String userName = session.getUser().getName();
-                log.info("File download : " + userName + " - " + fileName);
+                LOG.info("File download : " + userName + " - " + fileName);
                 
                 // notify the statistics component
                 ServerFtpStatistics ftpStat = (ServerFtpStatistics)serverContext.getFtpStatistics();
@@ -158,12 +161,12 @@
                 }
             }
             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, "RETR", fileName));
             }
             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, "RETR", fileName));
             }
@@ -179,7 +182,7 @@
                 try {
                     ftpletRet = ftpletContainer.onDownloadEnd(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/RMD.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RMD.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RMD.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RMD.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>RMD  &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -46,6 +47,7 @@
 public 
 class RMD extends AbstractCommand {
     
+    private static final Logger LOG = LoggerFactory.getLogger(RMD.class);
 
     /**
      * Execute command.
@@ -72,7 +74,7 @@
         try{
             ftpletRet = ftpletContainer.onRmdirStart(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, "RMD.permission", fileName));
@@ -115,8 +117,7 @@
             
             // write log message
             String userName = session.getUser().getName();
-            Log log = serverContext.getLogFactory().getInstance(getClass());
-            log.info("Directory remove : " + userName + " - " + fileName);
+            LOG.info("Directory remove : " + userName + " - " + fileName);
             
             // notify statistics object
             ServerFtpStatistics ftpStat = (ServerFtpStatistics)serverContext.getFtpStatistics();
@@ -126,7 +127,7 @@
             try{
                 ftpletRet = ftpletContainer.onRmdirEnd(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/RNFR.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNFR.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNFR.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNFR.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>RNFR &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -40,6 +42,9 @@
 public 
 class RNFR extends AbstractCommand {
 
+    
+    private static final Logger LOG = LoggerFactory.getLogger(RNFR.class);
+    
     /**
      * Execute command
      */
@@ -64,7 +69,7 @@
             renFr = session.getFileSystemView().getFileObject(fileName);
         }
         catch(Exception ex) {
-            log.debug("Exception getting file object", ex);
+            LOG.debug("Exception getting file object", ex);
         }
             
         // check file

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNTO.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNTO.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNTO.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNTO.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;
@@ -33,6 +32,8 @@
 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;
 
 /**
  * <code>RNTO &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -45,6 +46,7 @@
 public 
 class RNTO extends AbstractCommand {
     
+    private static final Logger LOG = LoggerFactory.getLogger(RNTO.class);
 
     /**
      * Execute command.
@@ -69,7 +71,7 @@
             try {
                 ftpletRet = ftpletContainer.onRenameStart(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) {
@@ -93,7 +95,7 @@
                 toFile = session.getFileSystemView().getFileObject(toFileStr);
             }
             catch(Exception ex) {
-                log.debug("Exception getting file object", ex);
+                LOG.debug("Exception getting file object", ex);
             }
             if(toFile == null) {
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_553_REQUESTED_ACTION_NOT_TAKEN_FILE_NAME_NOT_ALLOWED, "RNTO.invalid", null));
@@ -117,15 +119,14 @@
             if( frFile.move(toFile) ) { 
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_250_REQUESTED_FILE_ACTION_OKAY, "RNTO", toFileStr));
 
-                Log log = serverContext.getLogFactory().getInstance(getClass());
-                log.info("File rename (" + session.getUser().getName() + ") " 
+                LOG.info("File rename (" + session.getUser().getName() + ") " 
                                          + frFile.getFullName() + " -> " + toFile.getFullName());
                 
                 // call Ftplet.onRenameEnd() method
                 try {
                     ftpletRet = ftpletContainer.onRenameEnd(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/SITE.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE.java Sat Feb 24 07:50:22 2007
@@ -22,7 +22,6 @@
 import java.io.IOException;
 import java.util.HashMap;
 
-import org.apache.commons.logging.Log;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.ftplet.FtpReply;
@@ -34,6 +33,8 @@
 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;
 
 
 /**
@@ -42,6 +43,8 @@
 public 
 class SITE extends AbstractCommand {
 
+    private static final Logger LOG = LoggerFactory.getLogger(SITE.class);
+    
     private static final HashMap COMMAND_MAP = new HashMap(16);
     
     
@@ -60,7 +63,7 @@
         try {
             ftpletRet = ftpletContainer.onSite(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) {
@@ -101,8 +104,7 @@
             }
         }
         catch(Exception ex) {
-            Log log = serverContext.getLogFactory().getInstance(getClass());
-            log.warn("SITE.execute()", ex);
+            LOG.warn("SITE.execute()", ex);
             session.resetState();
             out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_500_SYNTAX_ERROR_COMMAND_UNRECOGNIZED, "SITE", null));
         }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_DESCUSER.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_DESCUSER.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_DESCUSER.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_DESCUSER.java Sat Feb 24 07:50:22 2007
@@ -34,6 +34,8 @@
 import org.apache.ftpserver.usermanager.TransferRateRequest;
 import org.apache.ftpserver.usermanager.WriteRequest;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * This SITE command returns the specified user information.
@@ -41,6 +43,8 @@
 public 
 class SITE_DESCUSER extends AbstractCommand {
 
+    private static final Logger LOG = LoggerFactory.getLogger(SITE_DESCUSER.class);
+    
     /**
      * Execute command.
      */
@@ -79,7 +83,7 @@
             }
         }
         catch(FtpException ex) {
-            log.debug("Exception trying to get user from user manager", ex);
+            LOG.debug("Exception trying to get user from user manager", ex);
             user = null;
         }
         if(user == null) {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SIZE.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SIZE.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SIZE.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SIZE.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>SIZE &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -38,6 +40,8 @@
 public 
 class SIZE extends AbstractCommand {
     
+    private static final Logger LOG = LoggerFactory.getLogger(SIZE.class);
+    
     /**
      * Execute command.
      */
@@ -62,7 +66,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, "SIZE.missing", fileName));

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOR.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOR.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOR.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOR.java Sat Feb 24 07:50:22 2007
@@ -37,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>STOR &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -52,6 +54,7 @@
 public 
 class STOR extends AbstractCommand {
     
+    private static final Logger LOG = LoggerFactory.getLogger(STOR.class);
 
     /**
      * Execute command.
@@ -80,7 +83,7 @@
             try {
                 ftpletRet = ftpletContainer.onUploadStart(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) {
@@ -97,7 +100,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, "STOR.invalid", fileName));
@@ -118,7 +121,7 @@
             try {
                 dataConnection = session.getFtpDataConnection().openConnection();
             } catch (Exception e) {
-                log.debug("Exception getting the input data stream", e);
+                LOG.debug("Exception getting the input data stream", e);
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_425_CANT_OPEN_DATA_CONNECTION, "STOR", fileName));
                 return;
             }
@@ -132,19 +135,19 @@
                 
                 // log message
                 String userName = session.getUser().getName();
-                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 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, "STOR", fileName));
             }
             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, "STOR", fileName));
             }
@@ -160,7 +163,7 @@
                 try {
                     ftpletRet = ftpletContainer.onUploadEnd(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/STOU.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java Sat Feb 24 07:50:22 2007
@@ -39,6 +39,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>STOU &lt;CRLF&gt;</code><br>
@@ -51,6 +53,7 @@
 public 
 class STOU extends AbstractCommand {
 
+    private static final Logger LOG = LoggerFactory.getLogger(STOU.class);
 
     /**
      * Execute command.
@@ -72,7 +75,7 @@
             try {
                 ftpletRet = ftpletContainer.onUploadUniqueStart(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) {
@@ -101,7 +104,7 @@
                 }
             }
             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, "STOU", null));
@@ -127,7 +130,7 @@
             try {
                 dataConnection = session.getFtpDataConnection().openConnection();
             } catch (Exception e) {
-                log.debug("Exception getting the input data stream", e);
+                LOG.debug("Exception getting the input data stream", e);
                 out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_425_CANT_OPEN_DATA_CONNECTION, "STOU", fileName));
                 return;
             }
@@ -142,7 +145,7 @@
                 
                 // log message
                 String userName = session.getUser().getName();
-                log.info("File upload : " + userName + " - " + fileName);
+                LOG.info("File upload : " + userName + " - " + fileName);
                 
                 // notify the statistics component
                 ServerFtpStatistics ftpStat = (ServerFtpStatistics)serverContext.getFtpStatistics();
@@ -151,12 +154,12 @@
                 }
             }
             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, "STOU", fileName));
             }
             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, "STOU", fileName));
             }
@@ -172,7 +175,7 @@
                 try {
                     ftpletRet = ftpletContainer.onUploadUniqueEnd(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/STRU.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STRU.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STRU.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STRU.java Sat Feb 24 07:50:22 2007
@@ -28,6 +28,8 @@
 import org.apache.ftpserver.ftplet.Structure;
 import org.apache.ftpserver.listener.Connection;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <code>STRU &lt;SP&gt; &lt;structure-code&gt; &lt;CRLF&gt;</code><br>
@@ -38,6 +40,8 @@
 public 
 class STRU extends AbstractCommand {
     
+    private static final Logger LOG = LoggerFactory.getLogger(STRU.class);
+    
     /**
      * Execute command
      */
@@ -62,7 +66,7 @@
             out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_200_COMMAND_OKAY, "STRU", null));
         } 
         catch(IllegalArgumentException e) {
-            log.debug("Illegal structure argument: " + request.getArgument(), e);
+            LOG.debug("Illegal structure argument: " + request.getArgument(), e);
             out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_504_COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER, "STRU", null));
         }
     }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/TYPE.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/TYPE.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/TYPE.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/TYPE.java Sat Feb 24 07:50:22 2007
@@ -28,6 +28,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>TYPE &lt;SP&gt; &lt;type-code&gt; &lt;CRLF&gt;</code><br>
@@ -37,6 +39,8 @@
 public 
 class TYPE extends AbstractCommand {
     
+    private static final Logger LOG = LoggerFactory.getLogger(TYPE.class);
+    
     /**
      * Execute command
      */
@@ -60,7 +64,7 @@
             out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_200_COMMAND_OKAY, "TYPE", null));
         } 
         catch(IllegalArgumentException e) {
-            log.debug("Illegal type argument: " + request.getArgument(), e);
+            LOG.debug("Illegal type argument: " + request.getArgument(), e);
             out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_504_COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER, "TYPE", null));
         }
     }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/commandline/Daemon.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/commandline/Daemon.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/commandline/Daemon.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/commandline/Daemon.java Sat Feb 24 07:50:22 2007
@@ -21,8 +21,6 @@
 
 import java.io.FileInputStream;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.ConfigurableFtpServerContext;
 import org.apache.ftpserver.FtpServer;
 import org.apache.ftpserver.config.PropertiesConfiguration;
@@ -32,6 +30,8 @@
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.util.IoUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Invokes FtpServer as a daemon, running in the background. 
@@ -39,7 +39,7 @@
  */
 public class Daemon {
 
-    private static Log log = LogFactory.getLog(Daemon.class);
+    private static final Logger LOG = LoggerFactory.getLogger(Daemon.class);
     
     private static FtpServer server;
     private static Object lock = new Object();
@@ -50,7 +50,7 @@
                 // get configuration
                 Configuration config = getConfiguration(args);
                 if(config == null) {
-                    log.error("No configuration provided");
+                    LOG.error("No configuration provided");
                     throw new FtpException("No configuration provided");
                 }
     
@@ -69,7 +69,7 @@
             
             
             if(command.equals("start")) {
-                log.info("Starting FTP server daemon");
+                LOG.info("Starting FTP server daemon");
                 server.start();
                 
                 synchronized (lock) {
@@ -79,11 +79,11 @@
                 synchronized (lock) {
                     lock.notify();
                 }
-                log.info("Stopping FTP server daemon");
+                LOG.info("Stopping FTP server daemon");
                 server.stop();
             }
         } catch(Throwable t) {
-            log.error("Daemon error", t);
+            LOG.error("Daemon error", t);
         }
     }
 
@@ -96,21 +96,21 @@
         FileInputStream in = null;
         try {
             if(args == null || args.length < 2) {
-                log.info("Using default configuration....");
+                LOG.info("Using default configuration....");
                 config = EmptyConfiguration.INSTANCE;
             }
             else if( (args.length == 2) && args[1].equals("-default") ) {
-                log.info("Using default configuration....");
+                LOG.info("Using default configuration....");
                 config = EmptyConfiguration.INSTANCE;
             }
             else if( (args.length == 3) && args[1].equals("-xml") ) {
-                log.info("Using xml configuration file " + args[2] + "...");
+                LOG.info("Using xml configuration file " + args[2] + "...");
                 in = new FileInputStream(args[2]);
                 XmlConfigurationHandler xmlHandler = new XmlConfigurationHandler(in);
                 config = xmlHandler.parse();
             }
             else if( (args.length == 3) && args[1].equals("-prop") ) {
-                log.info("Using properties configuration file " + args[2] + "...");
+                LOG.info("Using properties configuration file " + args[2] + "...");
                 in = new FileInputStream(args[2]);
                 config = new PropertiesConfiguration(in);
             } else {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/filesystem/NativeFileSystemManager.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/filesystem/NativeFileSystemManager.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/filesystem/NativeFileSystemManager.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/filesystem/NativeFileSystemManager.java Sat Feb 24 07:50:22 2007
@@ -21,14 +21,14 @@
 
 import java.io.File;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.ftplet.Component;
 import org.apache.ftpserver.ftplet.Configuration;
 import org.apache.ftpserver.ftplet.FileSystemManager;
 import org.apache.ftpserver.ftplet.FileSystemView;
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.ftplet.User;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Native file system manager. It uses the OS file system.
@@ -36,18 +36,11 @@
 public 
 class NativeFileSystemManager implements FileSystemManager, Component {
 
-    private Log log;
+    private static final Logger LOG = LoggerFactory.getLogger(NativeFileSystemManager.class);
+    
     private boolean createHome;
     private boolean caseInsensitive;
     
-    
-    /**
-     * Set the log factory.
-     */
-    public void setLogFactory(LogFactory factory) {
-        log = factory.getInstance(getClass());
-    }
-    
     /**
      * Configure the file system manager - does nothing.
      */
@@ -72,11 +65,11 @@
             String homeDirStr = user.getHomeDirectory();
             File homeDir = new File(homeDirStr);
             if(homeDir.isFile()) {
-                log.warn("Not a directory :: " + homeDirStr);
+                LOG.warn("Not a directory :: " + homeDirStr);
                 throw new FtpException("Not a directory :: " + homeDirStr);
             }
             if( (!homeDir.exists()) && (!homeDir.mkdirs()) ) {
-                log.warn("Cannot create user home :: " + homeDirStr);
+                LOG.warn("Cannot create user home :: " + homeDirStr);
                 throw new FtpException("Cannot create user home :: " + homeDirStr);
             }
         }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ftplet/DefaultFtpletContainer.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ftplet/DefaultFtpletContainer.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ftplet/DefaultFtpletContainer.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ftplet/DefaultFtpletContainer.java Sat Feb 24 07:50:22 2007
@@ -23,15 +23,16 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * This ftplet calls other ftplet methods and returns appropriate return value.
  */
 public class DefaultFtpletContainer implements Component, FtpletContainer {
     
-    private Log log;
+    private static final Logger LOG = LoggerFactory.getLogger(DefaultFtpletContainer.class);
+    
     private List ftplets = new ArrayList();
     
     private static class FtpletEntry {
@@ -55,15 +56,10 @@
                 ftpletEnt.ftplet.destroy();
             }
             catch(Exception ex) {
-                log.error(ftpletEnt.name + " :: FtpletHandler.destroy()", ex);
+                LOG.error(ftpletEnt.name + " :: FtpletHandler.destroy()", ex);
             }
         }
         ftplets.clear();
-        
-    }
-
-    public void setLogFactory(LogFactory logFact) {
-        log = logFact.getInstance(DefaultFtpletContainer.class);
         
     }
     

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/iprestrictor/FileIpRestrictor.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/iprestrictor/FileIpRestrictor.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/iprestrictor/FileIpRestrictor.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/iprestrictor/FileIpRestrictor.java Sat Feb 24 07:50:22 2007
@@ -27,14 +27,14 @@
 import java.net.InetAddress;
 import java.util.ArrayList;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.ftplet.Component;
 import org.apache.ftpserver.ftplet.Configuration;
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.interfaces.IpRestrictor;
 import org.apache.ftpserver.util.IoUtils;
 import org.apache.ftpserver.util.RegularExpr;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * File based IP restrictor.
@@ -42,20 +42,13 @@
 public 
 class FileIpRestrictor implements IpRestrictor, Component {
 
+    private static final Logger LOG = LoggerFactory.getLogger(FileIpRestrictor.class);
+    
     private final static String LINE_SEP = System.getProperty("line.separator", "\n");
     
-    private Log log;
     private String file;
     private Object[][] permissions;
     
-    
-    /**
-     * Set the log factory.
-     */
-    public void setLogFactory(LogFactory factory) {
-        log = factory.getInstance(getClass());
-    }
-    
     /**
      * Configure the IP restrictor.
      */
@@ -64,7 +57,7 @@
         File dir = new File(file).getParentFile();
         if( (!dir.exists()) && (!dir.mkdirs()) ) {
             String dirName = dir.getAbsolutePath();
-            log.fatal("Cannot create directory - " + dirName);
+            LOG.error("Cannot create directory - " + dirName);
             throw new FtpException("Cannot create directory : " + dirName);
         }
         
@@ -117,7 +110,7 @@
                 }
             }
             catch(IOException ex) {
-                log.error("FileIpRestrictor.getPermissions()", ex);
+                LOG.error("FileIpRestrictor.getPermissions()", ex);
                 throw new FtpException("FileIpRestrictor.getPermissions()", ex);
             }
             finally {
@@ -149,7 +142,7 @@
             this.permissions = permissions;
         }
         catch(IOException ex) {
-            log.error("FileIpRestrictor.setPermissions()", ex);
+            LOG.error("FileIpRestrictor.setPermissions()", ex);
             throw new FtpException("FileIpRestrictor.setPermissions()", ex);
         }
         finally {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/AbstractConnection.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/AbstractConnection.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/AbstractConnection.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/AbstractConnection.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.FtpSession;
 import org.apache.ftpserver.interfaces.FtpServerContext;
@@ -34,7 +33,6 @@
 public abstract class AbstractConnection implements Connection {
     
     protected FtpServerContext serverContext;
-    protected Log log;
     
     protected FtpSessionImpl ftpSession;
     private ConnectionObserver observer;
@@ -55,7 +53,6 @@
      */
     public AbstractConnection(FtpServerContext serverContext) throws IOException {
         this.serverContext = serverContext;
-        log = this.serverContext.getLogFactory().getInstance(getClass());
     }
     
     /**

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/ConnectionManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/ConnectionManagerImpl.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/ConnectionManagerImpl.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/ConnectionManagerImpl.java Sat Feb 24 07:50:22 2007
@@ -26,14 +26,14 @@
 import java.util.TimerTask;
 import java.util.Vector;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.FtpDataConnectionFactory;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.ftplet.Component;
 import org.apache.ftpserver.ftplet.Configuration;
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.ftplet.FtpSession;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Connection service to manage all the connections (request handlers).
@@ -41,7 +41,7 @@
 public 
 class ConnectionManagerImpl implements ConnectionManager, Component {
 
-    private Log log;
+    private static final Logger LOG = LoggerFactory.getLogger(ConnectionManagerImpl.class);
     
     private ConnectionManagerObserver observer;              
     private Timer timer;
@@ -57,13 +57,6 @@
     
     
     /**
-     * Set the log factory.
-     */
-    public void setLogFactory(LogFactory factory) {
-        log = factory.getInstance(getClass());
-    }
-    
-    /**
      * Configure connection service
      */
     public void configure(Configuration config) throws FtpException {
@@ -267,7 +260,7 @@
 
                     // if the data connection is not active - close it
                     if(dataCon.isTimeout(currTime)) {
-                        log.info("Removing idle data connection for " + session.getUser());
+                        LOG.info("Removing idle data connection for " + session.getUser());
                         dataCon.closeDataSocket();
                     }
                 }
@@ -286,7 +279,7 @@
                 continue;
             }
             
-            log.info("Removing idle user " + session.getUser());
+            LOG.info("Removing idle user " + session.getUser());
             closeConnection(connection);
         }
     }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/FtpProtocolHandler.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/FtpProtocolHandler.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/FtpProtocolHandler.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/FtpProtocolHandler.java Sat Feb 24 07:50:22 2007
@@ -22,7 +22,6 @@
 import java.io.IOException;
 import java.net.InetAddress;
 
-import org.apache.commons.logging.Log;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.ftplet.FileSystemView;
@@ -39,19 +38,20 @@
 import org.apache.ftpserver.interfaces.IpRestrictor;
 import org.apache.ftpserver.interfaces.ServerFtpStatistics;
 import org.apache.ftpserver.util.FtpReplyUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Callback class for events during an FTP session. 
  */
 public class FtpProtocolHandler {
     
-    protected Log log;
+    private static final Logger LOG = LoggerFactory.getLogger(FtpProtocolHandler.class);
+    
     protected FtpServerContext serverContext;
     
     public FtpProtocolHandler(FtpServerContext serverContext) throws IOException {
         this.serverContext = serverContext;
-        
-        log = serverContext.getLogFactory().getInstance(FtpProtocolHandler.class);
     }
 
     public void onConnectionOpened(Connection connection, FtpSessionImpl session, FtpWriter writer) throws Exception {
@@ -68,7 +68,7 @@
         
         // write log message
         String hostAddress = clientAddr.getHostAddress();
-        log.info("Open connection - " + hostAddress);
+        LOG.info("Open connection - " + hostAddress);
         
         // notify ftp statistics
         ServerFtpStatistics ftpStat = (ServerFtpStatistics)serverContext.getFtpStatistics();
@@ -91,7 +91,7 @@
             // IP permission check
             IpRestrictor ipRestrictor = serverContext.getIpRestrictor();
             if( !ipRestrictor.hasPermission(clientAddr) ) {
-                log.warn("No permission to access from " + hostAddress);
+                LOG.warn("No permission to access from " + hostAddress);
                 writer.write(FtpReplyUtil.translate(session, FtpReply.REPLY_530_NOT_LOGGED_IN, "ip.restricted", null));
                 return;
             }
@@ -100,7 +100,7 @@
             int maxConnections = conManager.getMaxConnections();
             
             if(maxConnections != 0 && ftpStat.getCurrentConnectionNumber() > maxConnections) {
-                log.warn("Maximum connection limit reached.");
+                LOG.warn("Maximum connection limit reached.");
                 writer.write(FtpReplyUtil.translate(session, FtpReply.REPLY_530_NOT_LOGGED_IN, "connection.limit", null));
                 return;
             }
@@ -134,7 +134,7 @@
             ftpletContainer.onDisconnect(session, writer);
         }
         catch(Exception ex) {
-            log.warn("RequestHandler.close()", ex);
+            LOG.warn("RequestHandler.close()", ex);
         }
 
         // notify statistics object and close request
@@ -146,7 +146,7 @@
             User user = session.getUser();
             String userName = user != null ? user.getName() : "<Not logged in>";
             InetAddress clientAddr = session.getClientAddress(); 
-            log.info("Close connection : " + clientAddr.getHostAddress() + " - " + userName);
+            LOG.info("Close connection : " + clientAddr.getHostAddress() + " - " + userName);
             
             // logout if necessary and notify statistics
             if(session.isLoggedIn()) {
@@ -202,7 +202,7 @@
                throw (IOException)ex;
             }
             else {
-                log.warn("RequestHandler.service()", ex);
+                LOG.warn("RequestHandler.service()", ex);
             }
         }
     }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOConnection.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOConnection.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOConnection.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOConnection.java Sat Feb 24 07:50:22 2007
@@ -41,6 +41,8 @@
 import org.apache.ftpserver.listener.ConnectionObserver;
 import org.apache.ftpserver.listener.FtpProtocolHandler;
 import org.apache.ftpserver.util.IoUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -49,6 +51,8 @@
  */
 public class IOConnection extends AbstractConnection implements Runnable {
     
+    private static final Logger LOG = LoggerFactory.getLogger(IOConnection.class);
+    
     private Socket controlSocket;
     private IOFtpResponseOutput writer;
     private BufferedReader reader;
@@ -149,9 +153,9 @@
         } catch(SocketException ex) {
             // socket closed - no need to do anything
         } catch(SSLException ex) {
-            log.warn("The client did not initiate the SSL connection correctly", ex);
+            LOG.warn("The client did not initiate the SSL connection correctly", ex);
         } catch(Exception ex) {
-            log.warn("Client error, closing session", ex);
+            LOG.warn("Client error, closing session", ex);
         }
         finally {
             // close all resources if not done already
@@ -190,7 +194,7 @@
                 controlSocket.close();
             }
             catch(Exception ex) {
-                log.warn("RequestHandler.close()", ex);
+                LOG.warn("RequestHandler.close()", ex);
             }
             controlSocket = null;
         }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOListener.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOListener.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOListener.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOListener.java Sat Feb 24 07:50:22 2007
@@ -24,12 +24,13 @@
 import java.net.Socket;
 import java.net.SocketException;
 
-import org.apache.commons.logging.Log;
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.listener.AbstractListener;
 import org.apache.ftpserver.listener.Connection;
 import org.apache.ftpserver.listener.ConnectionManager;
 import org.apache.ftpserver.listener.Listener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * The default {@link Listener} implementation.
@@ -37,7 +38,7 @@
  */
 public class IOListener extends AbstractListener implements Runnable {
 
-    private Log log;
+    private static final Logger LOG = LoggerFactory.getLogger(IOListener.class);
 
     private FtpServerContext serverContext;
 
@@ -53,8 +54,6 @@
     public void start(FtpServerContext serverContext) throws Exception {
         this.serverContext = serverContext;
         
-        log = serverContext.getLogFactory().getInstance(getClass());
-
         serverSocket = createServerSocket();
 
         listenerThread = new Thread(this);
@@ -89,7 +88,7 @@
             throw new IllegalStateException("start() must be called before run()");
         }
         
-        log.info("Listener started on port " + serverSocket.getLocalPort());
+        LOG.info("Listener started on port " + serverSocket.getLocalPort());
 
         // serverContext might be null if stop has been called
         if (serverContext == null) {
@@ -124,7 +123,7 @@
             } catch (SocketException ex) {
                 return;
             } catch (Exception ex) {
-                log.debug("Listener ending", ex);
+                LOG.debug("Listener ending", ex);
                 return;
             }
         }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaListener.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaListener.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaListener.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaListener.java Sat Feb 24 07:50:22 2007
@@ -23,7 +23,6 @@
 import java.net.InetSocketAddress;
 import java.security.GeneralSecurityException;
 
-import org.apache.commons.logging.Log;
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.listener.AbstractListener;
 import org.apache.ftpserver.listener.FtpProtocolHandler;
@@ -35,6 +34,8 @@
 import org.apache.mina.transport.socket.nio.SocketAcceptor;
 import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
 import org.apache.mina.transport.socket.nio.SocketSessionConfig;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * The default {@link Listener} implementation.
@@ -42,7 +43,7 @@
  */
 public class MinaListener extends AbstractListener {
 
-    private Log log;
+    private static final Logger LOG = LoggerFactory.getLogger(MinaListener.class);
 
     private IoAcceptor acceptor = new SocketAcceptor();
     
@@ -59,8 +60,6 @@
      */
     public void start(FtpServerContext serverContext) throws Exception {
         
-        log = serverContext.getLogFactory().getInstance(getClass());
-        
         if(getServerAddress() != null) {
             address = new InetSocketAddress(getServerAddress(), getPort() );
         } else {
@@ -129,7 +128,7 @@
             try {
                 acceptor.bind(address, protocolHandler, cfg);
             } catch (IOException e) {
-                log.error("Failed to resume listener", e);
+                LOG.error("Failed to resume listener", e);
             }
         }
     }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/message/MessageResourceImpl.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/message/MessageResourceImpl.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/message/MessageResourceImpl.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/message/MessageResourceImpl.java Sat Feb 24 07:50:22 2007
@@ -30,13 +30,13 @@
 import java.util.Properties;
 import java.util.StringTokenizer;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.ftplet.Component;
 import org.apache.ftpserver.ftplet.Configuration;
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.interfaces.MessageResource;
 import org.apache.ftpserver.util.IoUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -49,9 +49,9 @@
 public 
 class MessageResourceImpl implements MessageResource, Component {
 
-    private final static String RESOURCE_PATH = "org/apache/ftpserver/message/";
+    private static final Logger LOG = LoggerFactory.getLogger(MessageResourceImpl.class);
     
-    private Log log;
+    private final static String RESOURCE_PATH = "org/apache/ftpserver/message/";
     
     private String[] languages;
     private HashMap messages;
@@ -62,14 +62,6 @@
         public Properties customProperties = new Properties();
     } 
     
-    
-    /**
-     * Set the log factory.
-     */
-    public void setLogFactory(LogFactory factory) {
-        log = factory.getInstance(getClass());
-    }
-    
     /**
      * Configure - load properties file.
      */
@@ -125,7 +117,7 @@
             }
         }
         catch(Exception ex) {
-            log.warn("MessageResourceImpl.createPropertiesPair()", ex);
+            LOG.warn("MessageResourceImpl.createPropertiesPair()", ex);
             throw new FtpException("MessageResourceImpl.createPropertiesPair()", ex);
         }
         finally {
@@ -148,7 +140,7 @@
             }
         }
         catch(Exception ex) {
-            log.warn("MessageResourceImpl.createPropertiesPair()", ex);
+            LOG.warn("MessageResourceImpl.createPropertiesPair()", ex);
             throw new FtpException("MessageResourceImpl.createPropertiesPair()", ex);
         }
         finally {
@@ -264,7 +256,7 @@
             prop.store(out, "Custom Messages");
         }
         catch(IOException ex) {
-            log.error("MessageResourceImpl.save()", ex);
+            LOG.error("MessageResourceImpl.save()", ex);
             throw new FtpException("MessageResourceImpl.save()", ex);
         }
         finally {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/socketfactory/FtpSocketFactory.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/socketfactory/FtpSocketFactory.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/socketfactory/FtpSocketFactory.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/socketfactory/FtpSocketFactory.java Sat Feb 24 07:50:22 2007
@@ -22,13 +22,13 @@
 import java.net.InetAddress;
 import java.net.ServerSocket;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.ftplet.Component;
 import org.apache.ftpserver.ftplet.Configuration;
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.interfaces.SocketFactory;
 import org.apache.ftpserver.interfaces.Ssl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -37,22 +37,12 @@
 public 
 class FtpSocketFactory implements SocketFactory, Component {
     
-    private Log log;
-    private LogFactory logFactory;
+    private static final Logger LOG = LoggerFactory.getLogger(FtpSocketFactory.class);
     
     private InetAddress serverAddress;
     private int port;
     private Ssl ssl;
     
-    
-    /**
-     * Set the log factory.
-     */
-    public void setLogFactory(LogFactory factory) {
-        logFactory = factory;
-        log = logFactory.getInstance(getClass());
-    }
-    
     /**
      * Configure the server
      */
@@ -85,7 +75,7 @@
             throw ex;
         }*/
         catch(Exception ex) {
-            log.fatal("FtpSocketFactory.configure()", ex);
+            LOG.error("FtpSocketFactory.configure()", ex);
             throw new FtpException("FtpSocketFactory.configure()", ex);
         }
     }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ssl/DefaultSsl.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ssl/DefaultSsl.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ssl/DefaultSsl.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/ssl/DefaultSsl.java Sat Feb 24 07:50:22 2007
@@ -36,11 +36,11 @@
 import javax.net.ssl.SSLSocketFactory;
 import javax.net.ssl.TrustManagerFactory;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.FtpServerConfigurationException;
 import org.apache.ftpserver.interfaces.Ssl;
 import org.apache.ftpserver.util.IoUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -49,7 +49,7 @@
  */
 public class DefaultSsl implements Ssl {
     
-    private Log log = LogFactory.getLog(DefaultSsl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(DefaultSsl.class);
     
     private File keystoreFile = new File("./res/.keystore");
     private String keystorePass = "password";   // TODO should we really default this value?
@@ -125,7 +125,7 @@
             sslContextMap = new HashMap();
         }
         catch(Exception ex) {
-            log.fatal("DefaultSsl.configure()", ex);
+            LOG.error("DefaultSsl.configure()", ex);
             throw new FtpServerConfigurationException("DefaultSsl.configure()", ex);
         }
     }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/DbUserManager.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/DbUserManager.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/DbUserManager.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/DbUserManager.java Sat Feb 24 07:50:22 2007
@@ -29,8 +29,6 @@
 
 import javax.sql.DataSource;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.FtpServerConfigurationException;
 import org.apache.ftpserver.ftplet.Authentication;
 import org.apache.ftpserver.ftplet.AuthenticationFailedException;
@@ -38,6 +36,8 @@
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.ftplet.User;
 import org.apache.ftpserver.util.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * This is another database based user manager class. It has been
@@ -50,7 +50,7 @@
  */
 public class DbUserManager extends AbstractUserManager {
     
-    private Log log;
+    private static final Logger LOG = LoggerFactory.getLogger(DbUserManager.class);
     
     private String insertUserStmt;
     private String updateUserStmt;
@@ -63,14 +63,6 @@
     private DataSource dataSource;
     private Connection cachedConnection;
     
-    
-    /**
-     * Set the log factory.
-     */
-    public void setLogFactory(LogFactory factory) {
-        log = factory.getInstance(getClass());
-    }
-    
     /**
      * Retrive the data source used by the user manager
      * @return The current data source
@@ -233,10 +225,10 @@
             // test the connection
             createConnection();
             
-            log.info("Database connection opened.");
+            LOG.info("Database connection opened.");
         }
         catch(SQLException ex) {
-            log.fatal("DbUserManager.configure()", ex);
+            LOG.error("DbUserManager.configure()", ex);
             throw new FtpServerConfigurationException("DbUserManager.configure()", ex);
         }
     }
@@ -259,7 +251,7 @@
             HashMap map = new HashMap();
             map.put( ATTR_LOGIN, escapeString(login) );
             String sql = StringUtils.replaceString(isAdminStmt, map);
-            log.info(sql);
+            LOG.info(sql);
             
             // execute query
             stmt = createConnection().createStatement();
@@ -267,7 +259,7 @@
             return rs.next();
         }
         catch(SQLException ex) {
-            log.error("DbUserManager.isAdmin()", ex);
+            LOG.error("DbUserManager.isAdmin()", ex);
             throw new FtpException("DbUserManager.isAdmin()", ex);
         }
         finally {
@@ -276,7 +268,7 @@
                     rs.close(); 
                 } 
                 catch(Exception ex) {
-                    log.error("DbUserManager.isAdmin()", ex);
+                    LOG.error("DbUserManager.isAdmin()", ex);
                 }
             }
             if(stmt != null) {
@@ -284,7 +276,7 @@
                     stmt.close(); 
                 } 
                 catch(Exception ex) {
-                    log.error("DbUserManager.isAdmin()", ex);
+                    LOG.error("DbUserManager.isAdmin()", ex);
                 }
             }
         }
@@ -301,7 +293,7 @@
             }
         }
         catch(SQLException ex) {
-            log.error("DbUserManager.prepareConnection()", ex);
+            LOG.error("DbUserManager.prepareConnection()", ex);
             isClosed = true;
         }
         
@@ -324,12 +316,12 @@
                 cachedConnection.close(); 
             } 
             catch(SQLException ex) {
-                log.error("DbUserManager.closeConnection()", ex);
+                LOG.error("DbUserManager.closeConnection()", ex);
             }
             cachedConnection = null;
         }
         
-        log.info("Database connection closed.");
+        LOG.info("Database connection closed.");
     }
     
     /**
@@ -341,7 +333,7 @@
         HashMap map = new HashMap();
         map.put( ATTR_LOGIN, escapeString(name) );
         String sql = StringUtils.replaceString(deleteUserStmt, map);
-        log.info(sql);
+        LOG.info(sql);
         
         // execute query
         Statement stmt = null;
@@ -350,7 +342,7 @@
             stmt.executeUpdate(sql);
         }
         catch(SQLException ex) {
-            log.error("DbUserManager.delete()", ex);
+            LOG.error("DbUserManager.delete()", ex);
             throw new FtpException("DbUserManager.delete()", ex);
         }
         finally {
@@ -359,7 +351,7 @@
                     stmt.close(); 
                 } 
                 catch(Exception ex) {
-                    log.error("DbUserManager.delete()", ex);
+                    LOG.error("DbUserManager.delete()", ex);
                 }
             }
         }
@@ -428,14 +420,14 @@
             else {
                 sql = StringUtils.replaceString(updateUserStmt, map);
             }
-            log.info(sql);
+            LOG.info(sql);
             
             // execute query
             stmt = createConnection().createStatement();
             stmt.executeUpdate(sql);
         }
         catch(SQLException ex) {
-            log.error("DbUserManager.save()", ex);
+            LOG.error("DbUserManager.save()", ex);
             throw new FtpException("DbUserManager.save()", ex);
         }
         finally {
@@ -444,7 +436,7 @@
                     stmt.close(); 
                 } 
                 catch(Exception ex) {
-                    log.error("DbUsermanager.error()", ex);
+                    LOG.error("DbUsermanager.error()", ex);
                 }
             }
         }
@@ -463,7 +455,7 @@
             HashMap map = new HashMap();
             map.put( ATTR_LOGIN, escapeString(name) );
             String sql = StringUtils.replaceString(selectUserStmt, map);
-            log.info(sql);
+            LOG.info(sql);
             
             // execute query
             stmt = createConnection().createStatement();
@@ -492,7 +484,7 @@
             return thisUser;
         }
         catch(SQLException ex) {
-            log.error("DbUserManager.getUserByName()", ex);
+            LOG.error("DbUserManager.getUserByName()", ex);
             throw new FtpException("DbUserManager.getUserByName()", ex);
         }
         finally {
@@ -501,7 +493,7 @@
                     rs.close(); 
                 } 
                 catch(Exception ex) {
-                    log.error("DbUserManager.getUserByName()", ex);
+                    LOG.error("DbUserManager.getUserByName()", ex);
                 }
             }
             if(stmt != null) {
@@ -509,7 +501,7 @@
                     stmt.close(); 
                 } 
                 catch(Exception ex) {
-                    log.error("DbUserManager.getUserByName()", ex);
+                    LOG.error("DbUserManager.getUserByName()", ex);
                 }
             }
         }
@@ -527,7 +519,7 @@
             HashMap map = new HashMap();
             map.put( ATTR_LOGIN, escapeString(name) );
             String sql = StringUtils.replaceString(selectUserStmt, map);
-            log.info(sql);
+            LOG.info(sql);
             
             // execute query
             stmt = createConnection().createStatement();
@@ -535,7 +527,7 @@
             return rs.next();
         }
         catch(SQLException ex) {
-            log.error("DbUserManager.doesExist()", ex);
+            LOG.error("DbUserManager.doesExist()", ex);
             throw new FtpException("DbUserManager.doesExist()", ex);
         }
         finally {
@@ -544,7 +536,7 @@
                     rs.close(); 
                 } 
                 catch(Exception ex) {
-                    log.error("DbUserManager.doesExist()", ex);
+                    LOG.error("DbUserManager.doesExist()", ex);
                 }
             }
             if(stmt != null) {
@@ -552,7 +544,7 @@
                     stmt.close(); 
                 } 
                 catch(Exception ex) {
-                    log.error("DbUserManager.doesExist()", ex);
+                    LOG.error("DbUserManager.doesExist()", ex);
                 }
             }
         }
@@ -569,7 +561,7 @@
             
             // create sql query
             String sql = selectAllStmt;
-            log.info(sql);
+            LOG.info(sql);
             
             // execute query
             stmt = createConnection().createStatement();
@@ -583,7 +575,7 @@
             return (String[]) names.toArray(new String[0]);
         }
         catch(SQLException ex) {
-            log.error("DbUserManager.getAllUserNames()", ex);
+            LOG.error("DbUserManager.getAllUserNames()", ex);
             throw new FtpException("DbUserManager.getAllUserNames()", ex);
         }
         finally {
@@ -592,7 +584,7 @@
                     rs.close(); 
                 } 
                 catch(Exception ex) {
-                    log.error("DbUserManager.getAllUserNames()", ex);
+                    LOG.error("DbUserManager.getAllUserNames()", ex);
                 }
             }
             if(stmt != null) {
@@ -600,7 +592,7 @@
                     stmt.close(); 
                 } 
                 catch(Exception ex) {
-                    log.error("DbUserManager.getAllUserNames()", ex);
+                    LOG.error("DbUserManager.getAllUserNames()", ex);
                 }
             }
         }
@@ -629,7 +621,7 @@
         HashMap map = new HashMap();
         map.put( ATTR_LOGIN, escapeString(user.getName()) );
         String sql = StringUtils.replaceString(selectUserStmt, map);
-        log.info(sql);
+        LOG.info(sql);
         
         // execute query
         Statement stmt = null;
@@ -647,7 +639,7 @@
                     rs.close(); 
                 } 
                 catch(Exception ex) {
-                    log.error("DbUserManager.getPassword()", ex);
+                    LOG.error("DbUserManager.getPassword()", ex);
                 }
             }
             if(stmt != null) {
@@ -655,7 +647,7 @@
                     stmt.close(); 
                 } 
                 catch(Exception ex) {
-                    log.error("DbUserManager.getPassword()", ex);
+                    LOG.error("DbUserManager.getPassword()", ex);
                 }
             }
         }
@@ -693,7 +685,7 @@
                 map.put( ATTR_LOGIN, escapeString(user) );
                 map.put( ATTR_PASSWORD, escapeString(password) );
                 String sql = StringUtils.replaceString(authenticateStmt, map);
-                log.info(sql);
+                LOG.info(sql);
                 
                 // execute query
                 stmt = createConnection().createStatement();
@@ -708,7 +700,7 @@
                     throw new AuthenticationFailedException("Authentication failed");
                 }
             } catch(SQLException ex) {
-                log.error("DbUserManager.authenticate()", ex);
+                LOG.error("DbUserManager.authenticate()", ex);
                 throw new AuthenticationFailedException("Authentication failed", ex);
             }
             finally {
@@ -717,7 +709,7 @@
                         rs.close(); 
                     } 
                     catch(Exception ex) {
-                        log.error("DbUserManager.authenticate()", ex);
+                        LOG.error("DbUserManager.authenticate()", ex);
                     }
                 }
                 if(stmt != null) {
@@ -725,7 +717,7 @@
                         stmt.close(); 
                     } 
                     catch(Exception ex) {
-                        log.error("DbUserManager.authenticate()", ex);
+                        LOG.error("DbUserManager.authenticate()", ex);
                     }
                 }
             }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/LdapUserManager.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/LdapUserManager.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/LdapUserManager.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/LdapUserManager.java Sat Feb 24 07:50:22 2007
@@ -34,14 +34,14 @@
 import javax.naming.directory.InitialDirContext;
 import javax.naming.directory.SearchResult;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.ftplet.Authentication;
 import org.apache.ftpserver.ftplet.AuthenticationFailedException;
 import org.apache.ftpserver.ftplet.Component;
 import org.apache.ftpserver.ftplet.Configuration;
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.ftplet.User;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Ldap based user manager class where the object class is ftpusers. This has
@@ -51,6 +51,8 @@
 public
 class LdapUserManager extends AbstractUserManager implements Component {
     
+    private static final Logger LOG = LoggerFactory.getLogger(LdapUserManager.class);
+    
     // LDAP attributes
     private final static String CN         = "cn";
     private final static String CLASS_NAME = "javaClassName";
@@ -60,20 +62,11 @@
         CN
     };
     
-    private Log log;
-    
     private String adminName;
     private DirContext adminContext;
     private String userBaseDn;
     private Attribute objClassAttr;
-    
-    
-    /**
-     * Set the log factory.
-     */
-    public void setLogFactory(LogFactory factory) {
-        log = factory.getInstance(getClass());
-    }
+
     
     /**
      * Instantiate LDAP based <code>UserManager</code> implementation.
@@ -107,13 +100,13 @@
             objClassAttr.add("javaObject");
             objClassAttr.add("top");
             
-            log.info("LDAP user manager opened.");
+            LOG.info("LDAP user manager opened.");
         }
         catch(FtpException ex) {
             throw ex;
         }
         catch(Exception ex) {
-            log.fatal("LdapUserManager.configure()", ex);
+            LOG.error("LdapUserManager.configure()", ex);
             throw new FtpException("LdapUserManager.configure()", ex);
         }
     }
@@ -143,7 +136,7 @@
             matchAttrs.put(objClassAttr);
             matchAttrs.put( new BasicAttribute(CLASS_NAME, BaseUser.class.getName()) );
             NamingEnumeration answers = adminContext.search(userBaseDn, matchAttrs, CN_ATTRS);
-            log.info("Getting all users under " + userBaseDn);
+            LOG.info("Getting all users under " + userBaseDn);
             
             // populate list
             ArrayList allUsers = new ArrayList();
@@ -156,7 +149,7 @@
             return (String[]) allUsers.toArray(new String[0]);
         }
         catch(NamingException ex) {
-            log.error("LdapUserManager.getAllUserNames()", ex);
+            LOG.error("LdapUserManager.getAllUserNames()", ex);
             throw new FtpException("LdapUserManager.getAllUserNames()", ex);
         }
     } 
@@ -169,11 +162,11 @@
         User user = null;
         try {
             String dn = getDN(name);
-            log.info("Getting user object for " + dn);
+            LOG.info("Getting user object for " + dn);
             user = (User)adminContext.lookup(dn);
         }
         catch(NamingException ex) {
-            log.debug("Failed to retrive user: " + name, ex);
+            LOG.debug("Failed to retrive user: " + name, ex);
             user = null;
         }
         return user;
@@ -247,11 +240,11 @@
             attrs.put(new BasicAttribute(CLASS_NAME, BaseUser.class.getName()));
             
             // bind object
-            log.info("Rebinding user " + dn);
+            LOG.info("Rebinding user " + dn);
             adminContext.rebind(dn, newUser, attrs);
         }
         catch(NamingException ex) {
-            log.error("LdapUserManager.save()", ex);
+            LOG.error("LdapUserManager.save()", ex);
             throw new FtpException("LdapUserManager.save()", ex);
         }
     }
@@ -269,11 +262,11 @@
     public synchronized void delete(String userName) throws FtpException {
         try {
             String dn = getDN(userName);
-            log.info("Unbinding " + dn);
+            LOG.info("Unbinding " + dn);
             adminContext.unbind(dn);
         }
         catch(NamingException ex) {
-            log.error("LdapUserManager.delete()", ex);
+            LOG.error("LdapUserManager.delete()", ex);
             throw new FtpException("LdapUserManager.delete()", ex);
         }
     }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/PropertiesUserManager.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/PropertiesUserManager.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/PropertiesUserManager.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/PropertiesUserManager.java Sat Feb 24 07:50:22 2007
@@ -28,8 +28,6 @@
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.FtpServerConfigurationException;
 import org.apache.ftpserver.ftplet.Authentication;
 import org.apache.ftpserver.ftplet.AuthenticationFailedException;
@@ -39,6 +37,8 @@
 import org.apache.ftpserver.util.BaseProperties;
 import org.apache.ftpserver.util.EncryptUtils;
 import org.apache.ftpserver.util.IoUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -48,25 +48,17 @@
 public
 class PropertiesUserManager extends AbstractUserManager {
 
+    private static final Logger LOG = LoggerFactory.getLogger(PropertiesUserManager.class);
+    
     private final static String DEPRECATED_PREFIX    = "FtpServer.user.";
     private final static String PREFIX    = "ftpserver.user.";
 
-    private Log log;
-    
     private BaseProperties userDataProp;
     private File           userDataFile = new File("./res/user.gen");
     private boolean        isPasswordEncrypt = true;
 
 
-    private boolean isConfigured = false;
-    
-    
-    /**
-     * Set the log factory.
-     */
-    public void setLogFactory(LogFactory factory) {
-        log = factory.getInstance(getClass());
-    } 
+    private boolean isConfigured = false; 
     
     /**
      * Set the file used to store and read users. Must be set before 
@@ -231,7 +223,7 @@
                userDataProp.store(fos, "Generated file - don't edit (please)");
            }
            catch(IOException ex) {
-               log.error("Failed saving user data", ex);
+               LOG.error("Failed saving user data", ex);
                throw new FtpException("Failed saving user data", ex);
            }
            finally {

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ComponentBeanTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ComponentBeanTest.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ComponentBeanTest.java (original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ComponentBeanTest.java Sat Feb 24 07:50:22 2007
@@ -23,7 +23,6 @@
 
 import junit.framework.TestCase;
 
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.config.PropertiesConfiguration;
 import org.apache.ftpserver.ftplet.Component;
 import org.apache.ftpserver.ftplet.Configuration;
@@ -36,7 +35,6 @@
 
         public Configuration config;
         public boolean disposed = false;
-        public LogFactory logFactory;
         
         public void configure(Configuration config) throws FtpException {
             this.config = config;
@@ -45,10 +43,6 @@
         public void dispose() {
             disposed = true;
         }
-
-        public void setLogFactory(LogFactory logFactory) {
-            this.logFactory = logFactory;
-        }
         
     }
     
@@ -58,7 +52,7 @@
         props.setProperty("config.foo", "bar");
         PropertiesConfiguration config = new PropertiesConfiguration(props);
         
-        ComponentBean bean = (ComponentBean) Bean.createBean(config, null, null);
+        ComponentBean bean = (ComponentBean) Bean.createBean(config, null);
         
         MockComponent component = (MockComponent) bean.initBean();
         assertEquals("bar", component.config.getString("foo"));
@@ -76,7 +70,7 @@
         PropertiesConfiguration config = new PropertiesConfiguration(props);
         
         
-        ComponentBean bean = (ComponentBean) Bean.createBean(config, MockComponent.class.getName(), null);
+        ComponentBean bean = (ComponentBean) Bean.createBean(config, MockComponent.class.getName());
         
         MockComponent component = (MockComponent) bean.initBean();
         assertEquals("bar", component.config.getString("foo"));

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/PojoBeanTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/PojoBeanTest.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/PojoBeanTest.java (original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/PojoBeanTest.java Sat Feb 24 07:50:22 2007
@@ -23,7 +23,6 @@
 
 import junit.framework.TestCase;
 
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.config.PropertiesConfiguration;
 import org.apache.ftpserver.ftplet.Configuration;
 import org.apache.ftpserver.ftplet.FtpException;
@@ -36,7 +35,6 @@
         public Configuration config;
         public boolean configured = false;
         public boolean disposed = false;
-        public LogFactory logFactory;
         
         public String foo;
         public int bar;
@@ -50,7 +48,6 @@
         }
 
         public void configure() throws FtpException {
-            logFactory.getInstance(MockPojo.class).debug("test");
             
             configured = true;
         }
@@ -58,10 +55,6 @@
         public void dispose() {
             disposed = true;
         }
-
-        public void setLogFactory(LogFactory logFactory) {
-            this.logFactory = logFactory;
-        }
     }
     
     public void testLifecycle() throws Exception {
@@ -71,17 +64,14 @@
         props.setProperty("config.bar", "123");
 
         PropertiesConfiguration config = new PropertiesConfiguration(props);
-        
-        LogFactory logFactory = LogFactory.getFactory();
-        
-        PojoBean bean = (PojoBean) Bean.createBean(config, null, logFactory);
+
+        PojoBean bean = (PojoBean) Bean.createBean(config, null);
         
         MockPojo pojo = (MockPojo) bean.initBean();
         assertEquals("hello", pojo.foo);
         assertEquals(123, pojo.bar);
         assertFalse(pojo.disposed);
         assertTrue(pojo.configured);
-        assertSame(logFactory, pojo.logFactory);
 
         bean.destroyBean();
         assertTrue(pojo.disposed);

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/usermanager/DbUserManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/usermanager/DbUserManagerTest.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/usermanager/DbUserManagerTest.java (original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/usermanager/DbUserManagerTest.java Sat Feb 24 07:50:22 2007
@@ -24,7 +24,6 @@
 import java.sql.Connection;
 import java.sql.Statement;
 
-import org.apache.commons.logging.LogFactory;
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.ftplet.UserManager;
 import org.apache.ftpserver.test.TestUtil;
@@ -50,8 +49,6 @@
     
     protected UserManager createUserManager() throws FtpException {
         DbUserManager manager = new DbUserManager();
-        
-        manager.setLogFactory(LogFactory.getFactory());
         
         manager.setDataSource(ds);
         manager.setSqlUserInsert("INSERT INTO FTP_USER (uid, userpassword, homedirectory, enableflag, writepermission, idletime, uploadrate, downloadrate, maxloginnumber, maxloginperip) VALUES ('{uid}', '{userpassword}', '{homedirectory}', '{enableflag}', '{writepermission}', {idletime}, {uploadrate}, {downloadrate}, {maxloginnumber}, {maxloginperip})");

Modified: incubator/ftpserver/trunk/distribution/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/distribution/pom.xml?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/distribution/pom.xml (original)
+++ incubator/ftpserver/trunk/distribution/pom.xml Sat Feb 24 07:50:22 2007
@@ -105,34 +105,6 @@
       <artifactId>ftpserver-admin-gui</artifactId>
       <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>log4j</groupId>
-      <artifactId>log4j</artifactId>
-      <version>${log4j-version}</version>
-    </dependency>
   </dependencies>
   
   <profiles>

Modified: incubator/ftpserver/trunk/ftplet-api/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/ftplet-api/pom.xml?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/ftplet-api/pom.xml (original)
+++ incubator/ftpserver/trunk/ftplet-api/pom.xml Sat Feb 24 07:50:22 2007
@@ -16,29 +16,6 @@
   </scm>
   <dependencies>
     <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>junit</groupId>
       <artifactId>junit</artifactId>
       <version>${junit-version}</version>

Modified: incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/Component.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/Component.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/Component.java (original)
+++ incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/Component.java Sat Feb 24 07:50:22 2007
@@ -19,13 +19,11 @@
 
 package org.apache.ftpserver.ftplet;
 
-import org.apache.commons.logging.LogFactory;
 
 /**
  * This interface abstracts the basic lifecycle method. 
  * <ol>
  *     <li>Default constructor will be called.</li>
- *     <li>Set the LogFactory.</li>
  *     <li>The component will be configured using Component.configure(Configuration)</li>
  *     <li>Other component specific methods will be called.</li>
  *     <li>Finnaly Component.dispose() method will be called.</li>
@@ -33,11 +31,6 @@
  */
 public 
 interface Component {
-
-    /**
-     * Set the LogFactory.
-     */
-    void setLogFactory(LogFactory logFact);
     
     /**
      * Configure the component.

Modified: incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpletContext.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpletContext.java?view=diff&rev=511288&r1=511287&r2=511288
==============================================================================
--- incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpletContext.java (original)
+++ incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpletContext.java Sat Feb 24 07:50:22 2007
@@ -19,7 +19,6 @@
 
 package org.apache.ftpserver.ftplet;
 
-import org.apache.commons.logging.LogFactory;
 
 /**
  * A ftplet configuration object used by a ftplet container used to pass 
@@ -28,11 +27,6 @@
  */
 public 
 interface FtpletContext {
-
-    /**
-     * Get the log factory.
-     */
-    public LogFactory getLogFactory();
     
     /**
      * Get the user manager.



Mime
View raw message