Discuss (FTP) and (SFTP, FTPS and SCP), our Java file transfer clients.
no avatar
User

royayala

Posts

7

Joined

Tue Sep 09, 2008 7:40 am

Location

San Diego, California

setting debug level to log file is creating an empty file

by royayala » Tue Nov 16, 2010 8:11 am

We are trying to log to a file with the Logger set to debug but we keep getting an empty file. We are trying to research a problem with using FTPs sending large files to an IBM mainframe. I suspect we need to upgrade our client but I don't know how to get the version information and I assume this info would be in the debug level. I have included a portion of our java code. If you need the entire program I will send it but I was not sure how to attach a file.

package com.egateway.MF;

import com.enterprisedt.net.ftp.FTPTransferType;
import com.enterprisedt.net.ftp.FTPException;
import com.enterprisedt.net.ftp.ssl.SSLFTPClient;
import com.enterprisedt.net.ftp.ssl.SSLFTPStandardValidator;
import com.enterprisedt.util.debug.Level;
import com.enterprisedt.util.debug.Logger;
import com.enterprisedt.util.debug.FileAppender;
import com.enterprisedt.util.debug.StandardOutputAppender;
import java.io.*;
import java.util.*;
import java.net.*;
import java.text.*;


public class wmPush2MF_new {
final static String debug = "all";
public static void main(String[] args) {
System.out.println("Setting SSL debugging to :" + debug);
System.setProperty("javax.net.debug", debug);
String password = "NotUsed";
//Logger log = Logger.getLogger(wmPush2MF_new.class);
//Logger.setLevel(Level.DEBUG);
try {

// set up logger so that we get some output
Logger log = Logger.getLogger(wmPush2MF_new.class);
Logger.setLevel(Level.DEBUG);

// log to a file and also to standard output
Logger.addAppender(new FileAppender("logs/MF_ftps.log"));
Logger.addAppender(new StandardOutputAppender());
log.info("This is an info message");

SSLFTPClient ftp = null;
// path to files
String absolutePath = "";
File sourceDirectory = new File(args[0]); // [0] directory


Roy
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: setting debug level to log file is creating an empty fil

by support2 » Tue Nov 16, 2010 12:03 pm

Maybe try the full path of the log file, or leave off the "logs" directory just to get started

Who is online

Users browsing this forum: No registered users and 119 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign