title: How to log "220 server ready" message after connecting with Apache FTPSClient
body: <p>I'm writing a simple FTPS client using Apache Commons Net. Everything works fine, but the initial "server ready" message isn't being logged. I call <code>connect()</code> and do a <code>getReplyString()</code> immediately afterward, and all it logs is <code>234 Enabling TLS, awaiting negotiations</code> even though I know the server is sending a message after it connects: </p>
  
  <p><code>220 FTPS (Version  Fri Jan 22 19:49:50 2016) server ready.</code></p>
  
  <p>I've even used <code>getReplyStrings()</code> to see if there are more than one message, but it still only shows the one <code>234 Enabling TLS, awaiting negotiations</code> message. I have a feeling it's because that's the only reply to the <code>AUTH TLS</code> command that gets automatically issued when I connect (explicit TLS).</p>
  
  <p>I made a hack that scrapes the ProtocolCommandListener output and grabs the message that way, but I'd rather do it correctly. I have a feeling I'm missing something simple. Can anyone help?</p>
  
  <p>Code:</p>
  
  <pre><code>FTPSClient ftpsclient = new FTPSClient("TLSv1.2");
  
  // my hacked attempt to get the message
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  PrintStream ps = new PrintStream(baos,true,"utf-8");
  ftpsclient.addProtocolCommandListener(new PrintCommandListener(ps, true));
  
  logMessage("Connecting to FTP-SSL server [" + HOST + "] on port [" + PORT + "]...", 1);
  ftpsclient.connect(HOST, PORT);
  _logger.debug("Output: "+ baos.toString()); 
  if (!FTPReply.isPositiveCompletion(ftpsclient.getReplyCode())) {
      throw new Exception("Failed to connect to [" + HOST + "]\n" + ftpsclient.getReplyString());
  }
  logMessage(ftpsclient.getReplyString(), 1);
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>[Jan 22, 16:49:50] INFO logMessage() - Connecting to FTP-SSL server [HOST] on port [PORT]...
  [Jan 22, 16:49:55] DEBUG - Output: 220 FTPS (Version  Fri Jan 22 19:49:50 2016) server ready.
  AUTH TLS
  234 Enabling TLS, awaiting negotiations.
  [Jan 22, 16:49:55] INFO  EDIDataExtractor.logMessage() - 234 Enabling TLS, awaiting negotiations.
  </code></pre>